-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (93 loc) · 3.5 KB
/
appimage.yml
File metadata and controls
96 lines (93 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Anylinux-AppImage
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
on:
schedule:
- cron: "0 7 * * 1" # Check for new version every Monday
workflow_dispatch: {}
jobs:
check-version:
name: Check AUR version
runs-on: ubuntu-latest
outputs:
version_changed: ${{ steps.check.outputs.changed }}
aur_version: ${{ steps.check.outputs.version }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Compare AUR version with latest release
id: check
run: |
AUR_VERSION=$(curl -sL "https://aur.archlinux.org/rpc/v5/info?arg[]=qownnotes" \
| jq -r '.results[0].Version')
echo "AUR version: ${AUR_VERSION}"
echo "version=${AUR_VERSION}" >> "${GITHUB_OUTPUT}"
if [ -f ./LATEST_VERSION ]; then
LATEST=$(cat ./LATEST_VERSION | tr -d '[:space:]')
echo "Latest released: ${LATEST}"
if [ "${AUR_VERSION}" = "${LATEST}" ]; then
echo "Version unchanged, skipping build."
echo "changed=false" >> "${GITHUB_OUTPUT}"
exit 0
fi
fi
echo "New version detected (or no previous release). Will build."
echo "changed=true" >> "${GITHUB_OUTPUT}"
build:
needs: check-version
if: needs.check-version.outputs.version_changed == 'true'
name: "${{ matrix.name }} (${{ matrix.arch }})"
runs-on: ${{ matrix.runs-on }}
strategy:
matrix:
include:
- runs-on: ubuntu-latest
name: Build AppImage
arch: x86_64
- runs-on: ubuntu-24.04-arm
name: Build AppImage
arch: aarch64
container: ghcr.io/pkgforge-dev/archlinux:latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Preparing Container
uses: pkgforge-dev/anylinux-setup-action@8872fabe63f9a00b35e25b2f46da62a05afc9a7d # v1
- name: Install Dependencies
run: /bin/sh ./get-dependencies.sh
- name: Make AppImage
run: /bin/sh ./make-appimage.sh
- name: Upload artifact
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: AppImage-${{ matrix.arch }}
path: dist
release:
if: ${{ github.ref_name == 'main' }}
needs: [check-version, build]
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
pattern: AppImage-*
merge-multiple: true
- name: Release AppImage
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3
with:
name: "QOwnNotes: ${{ needs.check-version.outputs.aur_version }}"
tag_name: "${{ needs.check-version.outputs.aur_version }}"
prerelease: false
draft: false
generate_release_notes: false
make_latest: true
files: |
*.AppImage*
- name: Update LATEST_VERSION
run: |
echo "${{ needs.check-version.outputs.aur_version }}" > ./LATEST_VERSION
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add ./LATEST_VERSION
git commit --allow-empty -m 'bump `LATEST_VERSION` [skip ci]'
git push