Skip to content

Commit

Permalink
add auto update action
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaojianli authored Sep 29, 2024
1 parent 78feb8d commit 11f0ed0
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 7 deletions.
37 changes: 31 additions & 6 deletions .github/workflows/auto_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,43 @@ name: Update Latest
on:
workflow_dispatch:


jobs:
UpdateToLatest:
name: Update to Latest
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- id: getRelease
name: Fetch latest release
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: photoprism/photoprism
- run: |
VERSION=`echo "${{ steps.getRelease.outputs.release }}"|cut -d "-" -f 1``
sed -i "s/DISTVERSION=.*/DISTVERSION=g${VERSION}/g" Makefile
sed -i "s/GH_TAGNAME=.*/GH_TAGNAME=${{ steps.getRelease.outputs.release }}/g" Makefile
cat Makefile
- name: Update Makefile
run: |
export VERSION=`echo "${{ steps.getRelease.outputs.release }}"|cut -d "-" -f 1`
sed -i "s/DISTVERSION=.*/DISTVERSION= g20${VERSION}/g" Makefile
sed -i "s/GH_TAGNAME=.*/GH_TAGNAME= ${{ steps.getRelease.outputs.release }}/g" Makefile
- name: Build The Latest
uses: vmactions/freebsd-vm@v1
with:
usesh: true
prepare: |
pkg install -y gmake npm wget pkgconf git go122 portsnap ffmpeg p5-Image-ExifTool libheif vips bsddialog portconfig
mkdir -p /var/db/portsnap && portsnap --interactive auto > /dev/null
fetch https://github.com/lapo-luchini/libtensorflow1-freebsd-port/releases/download/v1.15.5_2/libtensorflow1-1.15.5_2.pkg-FreeBSD-14.0-amd64-AVX-SSE42.pkg -o /tmp/libtf.pkg
pkg add /tmp/libtf.pkg
run: |
git config --global --add safe.directory /home/runner/work/photoprism-freebsd-port/photoprism-freebsd-port
make makesum
make -j $(nproc)
make makeplist >pkg-plist
tail -n +2 pkg-plist >pkg-plist.tmp
mv pkg-plist.tmp pkg-plist
- name: Show diff
run: git diff
- name: Commit and push
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "[Auto update] Update to ${{ steps.getRelease.outputs.release }}"
54 changes: 54 additions & 0 deletions .github/workflows/build_pkg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Create Binary Pkg

on:
push:
branches:
- main

jobs:
build_14:
name: Build for FreeBSD 14
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build PKG
uses: vmactions/freebsd-vm@v1
with:
usesh: true
prepare: |
pkg install -y gmake npm wget pkgconf git go122 portsnap ffmpeg p5-Image-ExifTool libheif vips bsddialog portconfig
mkdir -p /var/db/portsnap && portsnap --interactive auto > /dev/null
fetch https://github.com/lapo-luchini/libtensorflow1-freebsd-port/releases/download/v1.15.5_2/libtensorflow1-1.15.5_2.pkg-FreeBSD-14.0-amd64-AVX-SSE42.pkg -o /tmp/libtf.pkg
pkg add /tmp/libtf.pkg
run: |
git config --global --add safe.directory /home/runner/work/photoprism-freebsd-port/photoprism-freebsd-port
make package
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: freebsd-14
path: |
work/pkg/*.pkg
build_13:
name: Build for FreeBSD 13
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build PKG
uses: vmactions/freebsd-vm@v1
with:
usesh: true
prepare: |
pkg install -y gmake npm wget pkgconf git go122 ffmpeg p5-Image-ExifTool libheif vips bsddialog portconfig
mkdir -p /var/db/portsnap && portsnap --interactive auto > /dev/null
fetch https://github.com/lapo-luchini/libtensorflow1-freebsd-port/releases/download/v1.15.5_2/libtensorflow1-1.15.5_2.pkg-FreeBSD-13.2-amd64-AVX-SSE42.pkg -o /tmp/libtf.pkg
pkg add /tmp/libtf.pkg
run: |
git config --global --add safe.directory /home/runner/work/photoprism-freebsd-port/photoprism-freebsd-port
make package
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: freebsd-13
path: |
work/pkg/*.pkg
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ EXTRACT_DEPENDS= ${RUN_DEPENDS} \

BUILD_DEPENDS= ${EXTRACT_DEPENDS}

USES= gmake go:1.21,modules python:3.6+,build
USES= gmake go:1.22,modules python:3.6+,build

USE_GITHUB= yes
GH_ACCOUNT= photoprism
Expand Down

0 comments on commit 11f0ed0

Please sign in to comment.