CI: Runner-Label auf 'docker' geändert + Forgejo API Upload
All checks were successful
Build AppImage / build (push) Has been skipped
All checks were successful
Build AppImage / build (push) Has been skipped
- runs-on: docker (statt ubuntu-latest) - Container: aspect-build/rust:stable-node22-bookworm - Manueller git clone mit REGISTRY_TOKEN - Forgejo API für Release-Upload (statt GitHub Action) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
e17d94a078
commit
2c64963553
1 changed files with 51 additions and 39 deletions
|
|
@ -12,62 +12,74 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
# Nur bei [appimage] im Commit oder bei Tag
|
runs-on: docker
|
||||||
if: contains(github.event.head_commit.message, '[appimage]') || startsWith(github.ref, 'refs/tags/v')
|
if: contains(github.event.head_commit.message, '[appimage]') || startsWith(github.ref, 'refs/tags/v')
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
container:
|
||||||
image: ghcr.io/tauri-apps/tauri-action-core:latest
|
image: ghcr.io/aspect-build/rust:stable-node22-bookworm
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
run: |
|
||||||
|
git clone --depth 1 --branch "${GITHUB_REF_NAME}" \
|
||||||
|
"https://oauth2:${{ secrets.REGISTRY_TOKEN }}@git.data-it-solution.de/${GITHUB_REPOSITORY}.git" .
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Install System Dependencies
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: '22'
|
|
||||||
cache: 'npm'
|
|
||||||
|
|
||||||
- name: Setup Rust
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
|
|
||||||
- name: Rust Cache
|
|
||||||
uses: Swatinem/rust-cache@v2
|
|
||||||
with:
|
|
||||||
workspaces: src-tauri
|
|
||||||
|
|
||||||
- name: Install Dependencies
|
|
||||||
run: |
|
run: |
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev
|
apt-get install -y \
|
||||||
|
libwebkit2gtk-4.1-dev \
|
||||||
|
libappindicator3-dev \
|
||||||
|
librsvg2-dev \
|
||||||
|
patchelf \
|
||||||
|
libssl-dev \
|
||||||
|
libgtk-3-dev \
|
||||||
|
libayatana-appindicator3-dev \
|
||||||
|
file
|
||||||
|
|
||||||
- name: Install npm packages
|
- name: Install npm packages
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Build Tauri App
|
- name: Build Tauri App
|
||||||
run: npm run tauri build -- --bundles appimage
|
run: |
|
||||||
env:
|
npm run tauri build -- --bundles appimage
|
||||||
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_KEY }}
|
ls -la src-tauri/target/release/bundle/appimage/
|
||||||
|
|
||||||
- name: Get Version
|
- name: Get Version
|
||||||
id: version
|
id: version
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(grep '^version' src-tauri/Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')
|
VERSION=$(grep '^version' src-tauri/Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')
|
||||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||||
echo "Version: $VERSION"
|
echo "Version: ${VERSION}"
|
||||||
|
|
||||||
- name: Upload AppImage Artifact
|
- name: Upload to Release
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: claude-desktop-${{ steps.version.outputs.version }}.AppImage
|
|
||||||
path: src-tauri/target/release/bundle/appimage/*.AppImage
|
|
||||||
|
|
||||||
# Bei Tag: Release erstellen und AppImage hochladen
|
|
||||||
- name: Create Release
|
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
uses: softprops/action-gh-release@v1
|
run: |
|
||||||
with:
|
APPIMAGE=$(ls src-tauri/target/release/bundle/appimage/*.AppImage | head -1)
|
||||||
files: src-tauri/target/release/bundle/appimage/*.AppImage
|
FILENAME=$(basename "$APPIMAGE")
|
||||||
generate_release_notes: true
|
TAG="${GITHUB_REF#refs/tags/}"
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
echo "Lade $FILENAME zu Release $TAG hoch..."
|
||||||
|
|
||||||
|
# Release erstellen falls nicht vorhanden
|
||||||
|
curl -s -X POST \
|
||||||
|
-H "Authorization: token ${{ secrets.REGISTRY_TOKEN }}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
"https://git.data-it-solution.de/api/v1/repos/${GITHUB_REPOSITORY}/releases" \
|
||||||
|
-d "{\"tag_name\":\"${TAG}\",\"name\":\"${TAG}\",\"body\":\"Release ${TAG}\"}" || true
|
||||||
|
|
||||||
|
# Release-ID holen
|
||||||
|
RELEASE_ID=$(curl -s \
|
||||||
|
-H "Authorization: token ${{ secrets.REGISTRY_TOKEN }}" \
|
||||||
|
"https://git.data-it-solution.de/api/v1/repos/${GITHUB_REPOSITORY}/releases/tags/${TAG}" \
|
||||||
|
| grep -o '"id":[0-9]*' | head -1 | sed 's/"id"://')
|
||||||
|
|
||||||
|
echo "Release-ID: $RELEASE_ID"
|
||||||
|
|
||||||
|
# AppImage hochladen
|
||||||
|
curl -s -X POST \
|
||||||
|
-H "Authorization: token ${{ secrets.REGISTRY_TOKEN }}" \
|
||||||
|
-H "Content-Type: application/octet-stream" \
|
||||||
|
"https://git.data-it-solution.de/api/v1/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=${FILENAME}" \
|
||||||
|
--data-binary "@${APPIMAGE}"
|
||||||
|
|
||||||
|
echo "Upload abgeschlossen: ${FILENAME}"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue