Skip to content

Commit

Permalink
Merge pull request #76 from Gaojianli/main
Browse files Browse the repository at this point in the history
The auto-update/build workflows
  • Loading branch information
huo-ju authored Sep 29, 2024
2 parents f673a91 + a0a46b3 commit 6bd6010
Show file tree
Hide file tree
Showing 6 changed files with 178 additions and 18 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/auto_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
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
- 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 }}"
- name: Create Release
uses: softprops/action-gh-release@v2
with:
body: Photoprism ${{ steps.getRelease.outputs.release }} packages for FreeBSD
tag_name: ${{ steps.getRelease.outputs.release }}
name: ${{ steps.getRelease.outputs.release }}
53 changes: 53 additions & 0 deletions .github/workflows/build_pkg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Create Binary Pkg

on:
workflow_call:

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:
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
python3.11 -c "import glob, os; [os.rename(f, f.replace('.pkg', '-FreeBSD-' + os.uname().release + '.pkg')) for f in glob.glob('work/pkg/*.pkg')]"
- 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:
release: "13.3"
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
python3.11 -c "import glob, os; [os.rename(f, f.replace('.pkg', '-FreeBSD-' + os.uname().release + '.pkg')) for f in glob.glob('work/pkg/*.pkg')]"
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: freebsd-13
path: |
work/pkg/*.pkg
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Release

on:
workflow_dispatch:
release:
types:
- published
workflow_run:
workflows: ["Update Latest"]
types: [completed]


jobs:
Build_Packages:
name: Build Packages
secrets: inherit
permissions:
contents: write
checks: write
actions: read
issues: read
packages: write
pull-requests: read
repository-projects: read
statuses: read
uses: ./.github/workflows/build_pkg.yml
Upload_Artifacts:
name: Upload to release artifacts
needs: Build_Packages
permissions:
contents: write
checks: write
actions: read
issues: read
packages: write
pull-requests: read
repository-projects: read
statuses: read
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: freebsd-14
path: target/
- uses: actions/download-artifact@v4
with:
name: freebsd-13
path: target/
- uses: alexellis/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '[ "target/*.pkg" ]'
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# $FreeBSD$

PORTNAME= photoprism
DISTVERSION= g20240711
DISTVERSION= g20240915
CATEGORIES= www

MAINTAINER= [email protected]
Expand All @@ -26,12 +26,12 @@ 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
GH_PROJECT= photoprism
GH_TAGNAME= 240711-2197af848
GH_TAGNAME= 240915-e1280b2fb

USE_RC_SUBR= photoprism
PHOTOPRISM_DATA_DIR= /var/db/photoprism
Expand Down
6 changes: 3 additions & 3 deletions distinfo
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
TIMESTAMP = 1721639281
SHA256 (photoprism-photoprism-g20240711-240711-2197af848_GH0.tar.gz) = 34b29308f64a50d2dbf482ccacbb7b5357e50f97e74a7ce0ee295c0a3bef695a
SIZE (photoprism-photoprism-g20240711-240711-2197af848_GH0.tar.gz) = 64940285
TIMESTAMP = 1727609221
SHA256 (photoprism-photoprism-g20240915-240915-e1280b2fb_GH0.tar.gz) = 11dd12b493f18f44e052ef71b1f29b7b5a4237fc27df3e8afb23c08f2989e369
SIZE (photoprism-photoprism-g20240915-240915-e1280b2fb_GH0.tar.gz) = 65012389
27 changes: 15 additions & 12 deletions pkg-plist
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
bin/photoprism
etc/rc.d/photoprism
/var/db/photoprism/assets/.buildignore
/var/db/photoprism/assets/README
/var/db/photoprism/assets/examples/.photoprism/example.jpg
Expand Down Expand Up @@ -112,6 +113,7 @@ bin/photoprism
/var/db/photoprism/assets/locales/fa/default.po
/var/db/photoprism/assets/locales/fi/default.po
/var/db/photoprism/assets/locales/fr/default.po
/var/db/photoprism/assets/locales/ga/default.po
/var/db/photoprism/assets/locales/he/default.po
/var/db/photoprism/assets/locales/hi/default.po
/var/db/photoprism/assets/locales/hr/default.po
Expand Down Expand Up @@ -677,12 +679,12 @@ bin/photoprism
/var/db/photoprism/assets/static/build/2d8017489da689caedc1.woff2
/var/db/photoprism/assets/static/build/698bd8550d863c20a3e1.ttf
/var/db/photoprism/assets/static/build/af9a28e7f261a412f581.eot
/var/db/photoprism/assets/static/build/app.1727d6ad9ff7e01d3bf5.js
/var/db/photoprism/assets/static/build/app.1727d6ad9ff7e01d3bf5.js.LICENSE.txt
/var/db/photoprism/assets/static/build/app.fc3e74d7360094f1a4f9.css
/var/db/photoprism/assets/static/build/app.405beb33c06fe9d84f44.css
/var/db/photoprism/assets/static/build/app.7c8896e06308b4527cda.js
/var/db/photoprism/assets/static/build/app.7c8896e06308b4527cda.js.LICENSE.txt
/var/db/photoprism/assets/static/build/assets.json
/var/db/photoprism/assets/static/build/f64c3af3d0d25b9e4e00.svg
/var/db/photoprism/assets/static/build/share.9e32a8334b90c4bf11f3.js
/var/db/photoprism/assets/static/build/share.73a026001890c81ab641.js
/var/db/photoprism/assets/static/build/sw.js
/var/db/photoprism/assets/static/font/Open Sans Bold/0-255.pbf
/var/db/photoprism/assets/static/font/Open Sans Bold/1024-1279.pbf
Expand All @@ -698,7 +700,7 @@ bin/photoprism
/var/db/photoprism/assets/static/font/Open Sans Bold/12544-12799.pbf
/var/db/photoprism/assets/static/font/Open Sans Bold/1280-1535.pbf
/var/db/photoprism/assets/static/font/Open Sans Bold/12800-13055.pbf
/var/db/photoprism/assets/static/font/Open Sans Bold/13056-13311.pbf
/var/db/photoprism/assets/static/font/Open Sans Bold/13056-13%%PYTHON_SUFFIX%%.pbf
/var/db/photoprism/assets/static/font/Open Sans Bold/13312-13567.pbf
/var/db/photoprism/assets/static/font/Open Sans Bold/13568-13823.pbf
/var/db/photoprism/assets/static/font/Open Sans Bold/13824-14079.pbf
Expand Down Expand Up @@ -836,7 +838,7 @@ bin/photoprism
/var/db/photoprism/assets/static/font/Open Sans Bold/44288-44543.pbf
/var/db/photoprism/assets/static/font/Open Sans Bold/44544-44799.pbf
/var/db/photoprism/assets/static/font/Open Sans Bold/44800-45055.pbf
/var/db/photoprism/assets/static/font/Open Sans Bold/45056-45311.pbf
/var/db/photoprism/assets/static/font/Open Sans Bold/45056-45%%PYTHON_SUFFIX%%.pbf
/var/db/photoprism/assets/static/font/Open Sans Bold/45312-45567.pbf
/var/db/photoprism/assets/static/font/Open Sans Bold/45568-45823.pbf
/var/db/photoprism/assets/static/font/Open Sans Bold/45824-46079.pbf
Expand Down Expand Up @@ -954,7 +956,7 @@ bin/photoprism
/var/db/photoprism/assets/static/font/Open Sans Italic/12544-12799.pbf
/var/db/photoprism/assets/static/font/Open Sans Italic/1280-1535.pbf
/var/db/photoprism/assets/static/font/Open Sans Italic/12800-13055.pbf
/var/db/photoprism/assets/static/font/Open Sans Italic/13056-13311.pbf
/var/db/photoprism/assets/static/font/Open Sans Italic/13056-13%%PYTHON_SUFFIX%%.pbf
/var/db/photoprism/assets/static/font/Open Sans Italic/13312-13567.pbf
/var/db/photoprism/assets/static/font/Open Sans Italic/13568-13823.pbf
/var/db/photoprism/assets/static/font/Open Sans Italic/13824-14079.pbf
Expand Down Expand Up @@ -1092,7 +1094,7 @@ bin/photoprism
/var/db/photoprism/assets/static/font/Open Sans Italic/44288-44543.pbf
/var/db/photoprism/assets/static/font/Open Sans Italic/44544-44799.pbf
/var/db/photoprism/assets/static/font/Open Sans Italic/44800-45055.pbf
/var/db/photoprism/assets/static/font/Open Sans Italic/45056-45311.pbf
/var/db/photoprism/assets/static/font/Open Sans Italic/45056-45%%PYTHON_SUFFIX%%.pbf
/var/db/photoprism/assets/static/font/Open Sans Italic/45312-45567.pbf
/var/db/photoprism/assets/static/font/Open Sans Italic/45568-45823.pbf
/var/db/photoprism/assets/static/font/Open Sans Italic/45824-46079.pbf
Expand Down Expand Up @@ -1210,7 +1212,7 @@ bin/photoprism
/var/db/photoprism/assets/static/font/Open Sans Regular/12544-12799.pbf
/var/db/photoprism/assets/static/font/Open Sans Regular/1280-1535.pbf
/var/db/photoprism/assets/static/font/Open Sans Regular/12800-13055.pbf
/var/db/photoprism/assets/static/font/Open Sans Regular/13056-13311.pbf
/var/db/photoprism/assets/static/font/Open Sans Regular/13056-13%%PYTHON_SUFFIX%%.pbf
/var/db/photoprism/assets/static/font/Open Sans Regular/13312-13567.pbf
/var/db/photoprism/assets/static/font/Open Sans Regular/13568-13823.pbf
/var/db/photoprism/assets/static/font/Open Sans Regular/13824-14079.pbf
Expand Down Expand Up @@ -1348,7 +1350,7 @@ bin/photoprism
/var/db/photoprism/assets/static/font/Open Sans Regular/44288-44543.pbf
/var/db/photoprism/assets/static/font/Open Sans Regular/44544-44799.pbf
/var/db/photoprism/assets/static/font/Open Sans Regular/44800-45055.pbf
/var/db/photoprism/assets/static/font/Open Sans Regular/45056-45311.pbf
/var/db/photoprism/assets/static/font/Open Sans Regular/45056-45%%PYTHON_SUFFIX%%.pbf
/var/db/photoprism/assets/static/font/Open Sans Regular/45312-45567.pbf
/var/db/photoprism/assets/static/font/Open Sans Regular/45568-45823.pbf
/var/db/photoprism/assets/static/font/Open Sans Regular/45824-46079.pbf
Expand Down Expand Up @@ -1466,7 +1468,7 @@ bin/photoprism
/var/db/photoprism/assets/static/font/Open Sans Semibold/12544-12799.pbf
/var/db/photoprism/assets/static/font/Open Sans Semibold/1280-1535.pbf
/var/db/photoprism/assets/static/font/Open Sans Semibold/12800-13055.pbf
/var/db/photoprism/assets/static/font/Open Sans Semibold/13056-13311.pbf
/var/db/photoprism/assets/static/font/Open Sans Semibold/13056-13%%PYTHON_SUFFIX%%.pbf
/var/db/photoprism/assets/static/font/Open Sans Semibold/13312-13567.pbf
/var/db/photoprism/assets/static/font/Open Sans Semibold/13568-13823.pbf
/var/db/photoprism/assets/static/font/Open Sans Semibold/13824-14079.pbf
Expand Down Expand Up @@ -1604,7 +1606,7 @@ bin/photoprism
/var/db/photoprism/assets/static/font/Open Sans Semibold/44288-44543.pbf
/var/db/photoprism/assets/static/font/Open Sans Semibold/44544-44799.pbf
/var/db/photoprism/assets/static/font/Open Sans Semibold/44800-45055.pbf
/var/db/photoprism/assets/static/font/Open Sans Semibold/45056-45311.pbf
/var/db/photoprism/assets/static/font/Open Sans Semibold/45056-45%%PYTHON_SUFFIX%%.pbf
/var/db/photoprism/assets/static/font/Open Sans Semibold/45312-45567.pbf
/var/db/photoprism/assets/static/font/Open Sans Semibold/45568-45823.pbf
/var/db/photoprism/assets/static/font/Open Sans Semibold/45824-46079.pbf
Expand Down Expand Up @@ -1978,6 +1980,7 @@ bin/photoprism
@dir /var/db/photoprism/assets/locales/fa
@dir /var/db/photoprism/assets/locales/fi
@dir /var/db/photoprism/assets/locales/fr
@dir /var/db/photoprism/assets/locales/ga
@dir /var/db/photoprism/assets/locales/he
@dir /var/db/photoprism/assets/locales/hi
@dir /var/db/photoprism/assets/locales/hr
Expand Down

0 comments on commit 6bd6010

Please sign in to comment.