feat(workflows): add matrix build and SHA256 generation for releases
- Introduce matrix strategy for building and uploading binaries for multiple architectures (amd64, arm64). - Generate SHA256 checksum files for release binaries. - Upload both binaries and their corresponding SHA256 files as release assets for better integrity verification.
This commit is contained in:
@@ -1,38 +1,27 @@
|
|||||||
# ========================
|
|
||||||
# 📦 Upload Assets Template
|
|
||||||
# ========================
|
|
||||||
# Dieser Workflow wird automatisch ausgelöst, wenn ein Release
|
|
||||||
# in Gitea veröffentlicht wurde (event: release.published).
|
|
||||||
#
|
|
||||||
# Er dient dem Zweck, Release-Artefakte (wie z. B. Binary-Dateien,
|
|
||||||
# Changelogs oder Build-Zips) nachträglich mit dem Release zu verknüpfen.
|
|
||||||
#
|
|
||||||
# Voraussetzung: Zwei Shell-Skripte liegen im Projekt:
|
|
||||||
# - .gitea/scripts/get-release-id.sh → ermittelt Release-ID per Tag
|
|
||||||
# - .gitea/scripts/upload-asset.sh → lädt Datei als Release-Asset hoch
|
|
||||||
#
|
|
||||||
# --------------------------------------
|
|
||||||
|
|
||||||
name: Upload Assets
|
name: Upload Assets
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [published] # Nur bei Veröffentlichung eines Releases (nicht bei Entwürfen)
|
types: [published]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
upload-assets:
|
upload-assets:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- target: linux
|
||||||
|
arch: amd64
|
||||||
|
- target: linux
|
||||||
|
arch: arm64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# 📥 Checke den Stand des Repos aus, exakt auf dem veröffentlichten Tag
|
|
||||||
# So ist garantiert, dass die Artefakte dem Zustand des Releases entsprechen.
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.release.tag_name }} # z. B. "v1.2.3"
|
ref: ${{ github.event.release.tag_name }}
|
||||||
fetch-depth: 0 # vollständige Git-Historie (für z. B. git-cliff, logs etc.)
|
fetch-depth: 0
|
||||||
|
|
||||||
# 🆔 Hole die Release-ID basierend auf dem Tag
|
|
||||||
# Die ID wird als Umgebungsvariable RELEASE_ID über $GITHUB_ENV verfügbar gemacht.
|
|
||||||
- name: Get Release ID from tag
|
- name: Get Release ID from tag
|
||||||
run: .gitea/scripts/get-release-id.sh "${{ github.event.release.tag_name }}"
|
run: .gitea/scripts/get-release-id.sh "${{ github.event.release.tag_name }}"
|
||||||
|
|
||||||
@@ -40,8 +29,16 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
deno-version: v2.x
|
deno-version: v2.x
|
||||||
|
|
||||||
- name: Build application
|
- name: Build ${{ matrix.target }}-${{ matrix.arch }}
|
||||||
run: deno task build
|
run: deno task build:${{ matrix.arch }}
|
||||||
|
|
||||||
- name: Upload CHANGELOG.md as RELEASE-NOTES.md
|
- name: Generate SHA256 for ${{ matrix.target }}-${{ matrix.arch }}
|
||||||
run: .gitea/scripts/upload-asset.sh ./dist/systemd-timer systemd-timer
|
run: |
|
||||||
|
FILE="./dist/systemd-timer-${{ matrix.target }}-${{ matrix.arch }}"
|
||||||
|
sha256sum "$FILE" > "$FILE.sha256"
|
||||||
|
|
||||||
|
- name: Upload binary for ${{ matrix.target }}-${{ matrix.arch }}
|
||||||
|
run: .gitea/scripts/upload-asset.sh ./dist/systemd-timer-${{ matrix.target }}-${{ matrix.arch }} systemd-timer-${{ matrix.target }}-${{ matrix.arch }}
|
||||||
|
|
||||||
|
- name: Upload SHA256 for ${{ matrix.target }}-${{ matrix.arch }}
|
||||||
|
run: .gitea/scripts/upload-asset.sh ./dist/systemd-timer-${{ matrix.target }}-${{ matrix.arch }}.sha256 systemd-timer-${{ matrix.target }}-${{ matrix.arch }}.sha256
|
||||||
|
Reference in New Issue
Block a user