CI: Release-Workflow (Tag v* → AppImage+deb auf ubuntu-latest, pacman auf arch/base-devel), PKGBUILD, .desktop, LICENSE
This commit is contained in:
100
.gitea/workflows/release.yml
Normal file
100
.gitea/workflows/release.yml
Normal file
@ -0,0 +1,100 @@
|
||||
name: Release (AppImage + deb + pacman)
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build-deb-appimage:
|
||||
name: AppImage + deb (Ubuntu)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: System-Abhängigkeiten
|
||||
run: |
|
||||
sudo apt-get update -q
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev \
|
||||
librsvg2-dev patchelf file
|
||||
|
||||
- name: Bauen (AppImage + deb)
|
||||
run: |
|
||||
node -v
|
||||
npm install
|
||||
npm run tauri build -- --bundles appimage,deb
|
||||
|
||||
- name: Release anlegen/ermitteln
|
||||
run: |
|
||||
VER=${GITHUB_REF_NAME}
|
||||
API="https://git.wlkns.org/api/v1/repos/wlkns-dev/hoerwerk"
|
||||
curl -sf -X POST \
|
||||
-H "Authorization: token $GITHUB_TOKEN" \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d "{\"tag_name\":\"$VER\",\"name\":\"Hörwerk $VER\",\"body\":\"Release $VER\",\"draft\":false,\"prerelease\":false}" \
|
||||
"$API/releases" > /tmp/rel.json || true
|
||||
RID=$(cat /tmp/rel.json | python3 -c 'import json,sys; print(json.load(sys.stdin).get("id",""))' 2>/dev/null || echo)
|
||||
if [ -z "$RID" ]; then
|
||||
curl -sf -H "Authorization: token $GITHUB_TOKEN" "$API/releases/tags/$VER" > /tmp/rel.json
|
||||
RID=$(python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])')
|
||||
fi
|
||||
echo "RELEASE_ID=$RID" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Anhängen (deb + AppImage)
|
||||
env:
|
||||
RELEASE_ID: ${{ env.RELEASE_ID }}
|
||||
run: |
|
||||
API="https://git.wlkns.org/api/v1/repos/wlkns-dev/hoerwerk"
|
||||
for f in src-tauri/target/release/bundle/appimage/*.AppImage src-tauri/target/release/bundle/deb/*.deb; do
|
||||
echo "Lade $(basename "$f") hoch…"
|
||||
curl -sf -X POST \
|
||||
-H "Authorization: token $GITHUB_TOKEN" \
|
||||
-F "attachment=@$f" \
|
||||
"$API/releases/$RELEASE_ID/assets?name=$(basename "$f")"
|
||||
done
|
||||
|
||||
build-pacman:
|
||||
name: pacman (Arch)
|
||||
runs-on: arch-base-devel
|
||||
steps:
|
||||
- name: Base aktualisieren
|
||||
run: pacman -Syu --noconfirm --needed nodejs npm
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: pacman-Paket bauen
|
||||
run: |
|
||||
cd packaging/arch
|
||||
sudo useradd -m builder || true
|
||||
chown -R builder:builder .
|
||||
sudo -u builder makepkg -sf --noconfirm
|
||||
|
||||
- name: Release anlegen/ermitteln
|
||||
run: |
|
||||
VER=${GITHUB_REF_NAME}
|
||||
API="https://git.wlkns.org/api/v1/repos/wlkns-dev/hoerwerk"
|
||||
curl -sf -X POST \
|
||||
-H "Authorization: token $GITHUB_TOKEN" \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d "{\"tag_name\":\"$VER\",\"name\":\"Hörwerk $VER\",\"body\":\"Release $VER\",\"draft\":false,\"prerelease\":false}" \
|
||||
"$API/releases" > /tmp/rel2.json || true
|
||||
RID=$(cat /tmp/rel2.json | python3 -c 'import json,sys; print(json.load(sys.stdin).get("id",""))' 2>/dev/null || echo)
|
||||
if [ -z "$RID" ]; then
|
||||
curl -sf -H "Authorization: token $GITHUB_TOKEN" "$API/releases/tags/$VER" > /tmp/rel2.json
|
||||
RID=$(python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])')
|
||||
fi
|
||||
echo "RELEASE_ID=$RID" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Anhängen (pacman)
|
||||
env:
|
||||
RELEASE_ID: ${{ env.RELEASE_ID }}
|
||||
run: |
|
||||
API="https://git.wlkns.org/api/v1/repos/wlkns-dev/hoerwerk"
|
||||
f=$(find . -name "hoerwerk-*.pkg.tar.zst" -type f | head -1)
|
||||
echo "Lade $(basename "$f") hoch…"
|
||||
curl -sf -X POST \
|
||||
-H "Authorization: token $GITHUB_TOKEN" \
|
||||
-F "attachment=@$f" \
|
||||
"$API/releases/$RELEASE_ID/assets?name=$(basename "$f")"
|
||||
Reference in New Issue
Block a user