Simplify Forgejo CI to Linux-only build
Some checks failed
Release / build-and-release (push) Has been cancelled
Some checks failed
Release / build-and-release (push) Has been cancelled
Remove Windows job (no Windows runner available) and merge build + release into a single job. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
640caf2617
commit
6771efd0b0
1 changed files with 12 additions and 112 deletions
|
|
@ -6,7 +6,7 @@ on:
|
|||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
build-and-release:
|
||||
runs-on: ubuntu
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
|
@ -40,76 +40,18 @@ jobs:
|
|||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
||||
run: npx tauri build
|
||||
|
||||
- name: Upload Linux artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: linux-artifacts
|
||||
path: |
|
||||
src-tauri/target/release/bundle/deb/*.deb
|
||||
src-tauri/target/release/bundle/appimage/*.AppImage
|
||||
src-tauri/target/release/bundle/appimage/*.AppImage.tar.gz
|
||||
src-tauri/target/release/bundle/appimage/*.AppImage.tar.gz.sig
|
||||
|
||||
build-windows:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: lts/*
|
||||
cache: npm
|
||||
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Cache Rust dependencies
|
||||
uses: swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: src-tauri
|
||||
|
||||
- name: Install frontend dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build Tauri
|
||||
env:
|
||||
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
||||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
||||
run: npx tauri build
|
||||
|
||||
- name: Upload Windows artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: windows-artifacts
|
||||
path: |
|
||||
src-tauri/target/release/bundle/nsis/*.exe
|
||||
src-tauri/target/release/bundle/nsis/*.nsis.zip
|
||||
src-tauri/target/release/bundle/nsis/*.nsis.zip.sig
|
||||
|
||||
release:
|
||||
needs: [build-linux, build-windows]
|
||||
runs-on: ubuntu
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download Linux artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: linux-artifacts
|
||||
path: artifacts/linux
|
||||
|
||||
- name: Download Windows artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: windows-artifacts
|
||||
path: artifacts/windows
|
||||
- name: Collect release files
|
||||
run: |
|
||||
mkdir -p release-assets
|
||||
cp src-tauri/target/release/bundle/deb/*.deb release-assets/ 2>/dev/null || true
|
||||
cp src-tauri/target/release/bundle/appimage/*.AppImage release-assets/ 2>/dev/null || true
|
||||
cp src-tauri/target/release/bundle/appimage/*.AppImage.tar.gz release-assets/ 2>/dev/null || true
|
||||
cp src-tauri/target/release/bundle/appimage/*.AppImage.tar.gz.sig release-assets/ 2>/dev/null || true
|
||||
cp src-tauri/target/release/bundle/rpm/*.rpm release-assets/ 2>/dev/null || true
|
||||
ls -la release-assets/
|
||||
|
||||
- name: Extract changelog
|
||||
id: changelog
|
||||
shell: bash
|
||||
run: |
|
||||
TAG="${GITHUB_REF_NAME#v}"
|
||||
NOTES=$(sed -n "/^## \[${TAG}\]/,/^## /{/^## \[${TAG}\]/d;/^## /d;p}" CHANGELOG.md)
|
||||
|
|
@ -123,37 +65,15 @@ jobs:
|
|||
echo "CHANGELOG_EOF"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Collect release files
|
||||
id: files
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p release-assets
|
||||
# Flatten nested artifact directories into release-assets/
|
||||
find artifacts -type f | while read f; do
|
||||
cp "$f" "release-assets/$(basename "$f")"
|
||||
done
|
||||
ls -la release-assets/
|
||||
|
||||
- name: Generate latest.json
|
||||
shell: bash
|
||||
run: |
|
||||
TAG="${GITHUB_REF_NAME}"
|
||||
VERSION="${TAG}"
|
||||
PUB_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
||||
BASE_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases/download/${TAG}"
|
||||
|
||||
# Read signatures
|
||||
WINDOWS_SIG=""
|
||||
LINUX_SIG=""
|
||||
NSIS_ZIP=""
|
||||
APPIMAGE_TAR=""
|
||||
|
||||
for f in release-assets/*.nsis.zip.sig; do
|
||||
[ -f "$f" ] && WINDOWS_SIG=$(cat "$f")
|
||||
done
|
||||
for f in release-assets/*.nsis.zip; do
|
||||
[ -f "$f" ] && NSIS_ZIP=$(basename "$f")
|
||||
done
|
||||
for f in release-assets/*.AppImage.tar.gz.sig; do
|
||||
[ -f "$f" ] && LINUX_SIG=$(cat "$f")
|
||||
done
|
||||
|
|
@ -161,14 +81,7 @@ jobs:
|
|||
[ -f "$f" ] && APPIMAGE_TAR=$(basename "$f")
|
||||
done
|
||||
|
||||
# Build latest.json
|
||||
PLATFORMS="{}"
|
||||
if [ -n "$WINDOWS_SIG" ] && [ -n "$NSIS_ZIP" ]; then
|
||||
PLATFORMS=$(echo "$PLATFORMS" | jq \
|
||||
--arg sig "$WINDOWS_SIG" \
|
||||
--arg url "${BASE_URL}/${NSIS_ZIP}" \
|
||||
'. + {"windows-x86_64": {"signature": $sig, "url": $url}}')
|
||||
fi
|
||||
if [ -n "$LINUX_SIG" ] && [ -n "$APPIMAGE_TAR" ]; then
|
||||
PLATFORMS=$(echo "$PLATFORMS" | jq \
|
||||
--arg sig "$LINUX_SIG" \
|
||||
|
|
@ -176,14 +89,9 @@ jobs:
|
|||
'. + {"linux-x86_64": {"signature": $sig, "url": $url}}')
|
||||
fi
|
||||
|
||||
NOTES=$(cat <<'NOTES_EOF'
|
||||
${{ steps.changelog.outputs.notes }}
|
||||
NOTES_EOF
|
||||
)
|
||||
|
||||
jq -n \
|
||||
--arg version "$VERSION" \
|
||||
--arg notes "$NOTES" \
|
||||
--arg version "$TAG" \
|
||||
--arg notes "${{ steps.changelog.outputs.notes }}" \
|
||||
--arg pub_date "$PUB_DATE" \
|
||||
--argjson platforms "$PLATFORMS" \
|
||||
'{version: $version, notes: $notes, pub_date: $pub_date, platforms: $platforms}' \
|
||||
|
|
@ -193,7 +101,6 @@ jobs:
|
|||
cat release-assets/latest.json
|
||||
|
||||
- name: Create release and upload assets
|
||||
shell: bash
|
||||
env:
|
||||
FORGEJO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
|
|
@ -208,13 +115,6 @@ jobs:
|
|||
|
||||
## Installation
|
||||
|
||||
**Windows** : Téléchargez le fichier `.exe` ci-dessous et lancez l'installation.
|
||||
|
||||
> **Note :** Windows SmartScreen peut afficher un avertissement car l'application n'est pas signée.
|
||||
> Cliquez sur **« Informations complémentaires »** puis **« Exécuter quand même »**.
|
||||
|
||||
> **Important :** Si vous aviez installé une version précédente via le fichier `.msi`, veuillez d'abord la désinstaller (Paramètres Windows > Applications) avant d'installer cette version.
|
||||
|
||||
**Linux** : Téléchargez le fichier `.deb` ou `.AppImage` ci-dessous.
|
||||
BODY_EOF
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue