@@ -4,11 +4,40 @@ concurrency:
44 cancel-in-progress : true
55on :
66 schedule :
7- - cron : " 0 7 1/21 * *" # We default to rebuilding every 21 days, change this to your liking
7+ - cron : " 0 7 * * 1 " # Check for new version every Monday
88 workflow_dispatch : {}
99
1010jobs :
11+ check-version :
12+ name : Check AUR version
13+ runs-on : ubuntu-latest
14+ outputs :
15+ version_changed : ${{ steps.check.outputs.changed }}
16+ aur_version : ${{ steps.check.outputs.version }}
17+ steps :
18+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19+ - name : Compare AUR version with latest release
20+ id : check
21+ run : |
22+ AUR_VERSION=$(curl -sL "https://aur.archlinux.org/rpc/v5/info?arg[]=qownnotes" \
23+ | jq -r '.results[0].Version')
24+ echo "AUR version: ${AUR_VERSION}"
25+ echo "version=${AUR_VERSION}" >> "${GITHUB_OUTPUT}"
26+ if [ -f ./LATEST_VERSION ]; then
27+ LATEST=$(cat ./LATEST_VERSION | tr -d '[:space:]')
28+ echo "Latest released: ${LATEST}"
29+ if [ "${AUR_VERSION}" = "${LATEST}" ]; then
30+ echo "Version unchanged, skipping build."
31+ echo "changed=false" >> "${GITHUB_OUTPUT}"
32+ exit 0
33+ fi
34+ fi
35+ echo "New version detected (or no previous release). Will build."
36+ echo "changed=true" >> "${GITHUB_OUTPUT}"
37+
1138 build :
39+ needs : check-version
40+ if : needs.check-version.outputs.version_changed == 'true'
1241 name : " ${{ matrix.name }} (${{ matrix.arch }})"
1342 runs-on : ${{ matrix.runs-on }}
1443 strategy :
1746 - runs-on : ubuntu-latest
1847 name : Build AppImage
1948 arch : x86_64
20- # comment out these 3 lines if aarch64 is not wanted
2149 - runs-on : ubuntu-24.04-arm
2250 name : Build AppImage
2351 arch : aarch64
4270 permissions : write-all
4371 runs-on : ubuntu-latest
4472 steps :
73+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4574 - uses : actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
4675 with :
4776 pattern : AppImage-*
4877 merge-multiple : true
4978 - name : Release AppImage
50- uses : pkgforge-dev/make-stable-appimage-release@4ed3d48ccb065352b6e6c0db6d39885b201c54a0 # v1.1
79+ uses : softprops/action-gh-release@5be0e66d93ac7ed76da52eca8bb058f665c3a5fe # v2.4.2
80+ with :
81+ name : " QOwnNotes: ${{ needs.check-version.outputs.aur_version }}"
82+ tag_name : " ${{ needs.check-version.outputs.aur_version }}"
83+ prerelease : false
84+ draft : false
85+ generate_release_notes : false
86+ make_latest : true
87+ files : |
88+ *.AppImage*
89+ - name : Update LATEST_VERSION
90+ run : |
91+ echo "${{ needs.check-version.outputs.aur_version }}" > ./LATEST_VERSION
92+ git config user.name "github-actions[bot]"
93+ git config user.email "github-actions[bot]@users.noreply.github.com"
94+ git add ./LATEST_VERSION
95+ git commit --allow-empty -m 'bump `LATEST_VERSION` [skip ci]'
96+ git push
0 commit comments