Files
Hellion-NewTab/.gitea/workflows/release.yml
T
JonKazama-Hellion a946e66c6c
Code Quality / Validate Extension (push) Successful in 5s
Security / scan (push) Successful in 18s
Release / Build & Release (push) Successful in 14s
ci(gitea): Release- und Quality-Workflow nach .gitea/ portieren, tote .github/-Workflows entfernen
2026-06-13 23:51:23 +02:00

105 lines
4.5 KiB
YAML

name: Release
# Wird bei einem vX.Y.Z-Tag-Push ausgeloest. Baut die drei Web-Extension-ZIPs
# (Chrome/Firefox/Opera) und haengt sie ans passende Gitea-Release.
#
# Portiert von GitHub Actions auf Gitea Actions (2026-06): der fruehere
# softprops/action-gh-release-Step ist GitHub-spezifisch und laeuft auf Gitea
# nicht. Ersetzt durch die Gitea-native release-action (volle gitea.com-URL,
# da DEFAULT_ACTIONS_URL=github nackte Namen sonst von github.com zieht).
# Muster uebernommen aus HellionChat/.gitea/workflows/release.yml.
on:
push:
tags:
- 'v*'
# Manueller Recovery-Trigger: in Gitea "Run workflow" und den Tag (z.B. v2.2.0)
# im Ref-Dropdown waehlen, NICHT master. Der Validate-Step unten failt hart
# bei einem Nicht-Tag-Ref, weil die release-action GITHUB_REF direkt liest.
workflow_dispatch:
permissions:
contents: write
jobs:
build-release:
name: Build & Release
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
# release-action liest GITHUB_REF direkt (kein tag_name-Input). Vorab
# validieren, damit manuelle Dispatches von einem Branch-Ref hier laut
# scheitern statt nach einem vollen Build.
- name: Validate tag ref
run: |
if [[ "${GITHUB_REF}" != refs/tags/v* ]]; then
echo "::error::Release-Workflow muss auf einem v*-Tag laufen, got ${GITHUB_REF}"
echo "::error::Tag pushen, oder im workflow_dispatch-Ref-Dropdown den Tag (nicht master) waehlen."
exit 1
fi
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Extract version from tag
id: version
run: echo "tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
- name: Create Chrome/Edge ZIP (Manifest V3)
run: |
mkdir -p dist
zip -r "dist/hellion-newtab-${{ steps.version.outputs.tag }}-chrome.zip" \
manifest.json newtab.html src/js/*.js src/css/ assets/ _locales/ \
-x "*.git*" "dist/*" ".github/*" ".gitea/*" "src/js/opera/*"
- name: Create Firefox ZIP (Manifest V3)
run: |
cp manifest.json manifest.chrome-backup.json
cp manifest.firefox.json manifest.json
zip -r "dist/hellion-newtab-${{ steps.version.outputs.tag }}-firefox.zip" \
manifest.json newtab.html src/js/*.js src/css/ assets/ _locales/ \
-x "*.git*" "dist/*" ".github/*" ".gitea/*" "manifest.chrome-backup.json" "manifest.firefox.json" "src/js/opera/*"
mv manifest.chrome-backup.json manifest.json
- name: Create Opera/Opera GX ZIP (Manifest V3 + workaround)
run: |
cp manifest.json manifest.chrome-backup.json
cp manifest.opera.json manifest.json
zip -r "dist/hellion-newtab-${{ steps.version.outputs.tag }}-opera.zip" \
manifest.json newtab.html src/js/*.js src/js/opera/ src/css/ assets/ _locales/ \
-x "*.git*" "dist/*" ".github/*" ".gitea/*" "manifest.chrome-backup.json" "manifest.opera.json"
mv manifest.chrome-backup.json manifest.json
- name: Generate SHA256 checksums
run: |
cd dist
sha256sum *.zip > checksums-sha256.txt
cat checksums-sha256.txt
# Gitea-native Release-Action. Legt das Release an, falls der Tag noch
# keins hat, oder aktualisiert das bestehende und haengt die Assets an.
# Der auto-injizierte GITHUB_TOKEN auf Gitea Actions hat Gitea-API-Scope
# und reicht fuer Release-Write.
- name: Attach to Gitea release
uses: https://gitea.com/actions/release-action@main
with:
files: |-
dist/hellion-newtab-${{ steps.version.outputs.tag }}-chrome.zip
dist/hellion-newtab-${{ steps.version.outputs.tag }}-firefox.zip
dist/hellion-newtab-${{ steps.version.outputs.tag }}-opera.zip
dist/checksums-sha256.txt
api_key: ${{ secrets.GITHUB_TOKEN }}
body: |
## Hellion NewTab ${{ steps.version.outputs.tag }}
### Installation
- **Chrome / Edge / Brave / Vivaldi:** `hellion-newtab-${{ steps.version.outputs.tag }}-chrome.zip`
- **Firefox:** `hellion-newtab-${{ steps.version.outputs.tag }}-firefox.zip`
- **Opera / Opera GX:** `hellion-newtab-${{ steps.version.outputs.tag }}-opera.zip`
Vollstaendige Installationsanleitung siehe README.
### Checksums
`checksums-sha256.txt` zum Verifizieren der Dateiintegritaet.