From ccfb18760128effdd997cdc973fe644485342c7f Mon Sep 17 00:00:00 2001 From: Rukira Date: Mon, 24 Aug 2026 16:56:00 +0100 Subject: [PATCH 1/2] feat(release): add Forgejo release step to GitHub Actions pipeline Co-authored-by: Junie --- .github/workflows/release.yml | 67 +++++++++++++++++++++++- docs/plans/feature-6-release-pipeline.md | 3 +- 2 files changed, 68 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cbb09a6..a31dc1a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -99,7 +99,7 @@ jobs: if-no-files-found: error create-release: - name: Create GitHub Release + name: Create GitHub & Forgejo Releases needs: - bump-version - package @@ -140,3 +140,68 @@ jobs: gh release create "${RELEASE_TAG}" dist/* \ --title "WoW Backup ${RELEASE_TAG}" \ --notes "${RELEASE_BODY}" + + - name: Publish Forgejo Release + env: + FORGEJO_PAT: ${{ secrets.FORGEJO_PAT }} + RELEASE_TAG: ${{ needs.bump-version.outputs.tag }} + RELEASE_VERSION: ${{ needs.bump-version.outputs.version }} + run: | + RELEASE_BODY="### WoW Backup ${RELEASE_TAG} + + Automated release build for **WoW Backup v${RELEASE_VERSION}**. + + #### Available Packages + - **macOS**: \`.dmg\` installer (Apple Silicon & Intel) + - **Windows**: \`.msi\` Windows Installer + - **Linux**: \`.deb\` package (Debian / Ubuntu) + + --- + For detailed setup and installation notes, please refer to [INSTALL.md](https://git.asarius.site/rukira/wow-backup/src/tag/${RELEASE_TAG}/INSTALL.md)." + + echo "Publishing release ${RELEASE_TAG} to Forgejo (git.asarius.site)..." + + PAYLOAD=$(jq -n \ + --arg tag "$RELEASE_TAG" \ + --arg name "WoW Backup ${RELEASE_TAG}" \ + --arg body "$RELEASE_BODY" \ + '{tag_name: $tag, name: $name, body: $body, draft: false, prerelease: false}') + + CREATE_RESPONSE=$(curl -sS -X POST \ + "https://git.asarius.site/api/v1/repos/rukira/wow-backup/releases" \ + -H "Authorization: token ${FORGEJO_PAT}" \ + -H "Content-Type: application/json" \ + -H "Accept: application/json" \ + -d "$PAYLOAD" || true) + + RELEASE_ID=$(echo "$CREATE_RESPONSE" | jq -r '.id // empty') + + if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" = "null" ]; then + echo "Release creation did not return an ID, checking if release already exists for tag ${RELEASE_TAG}..." + GET_RESPONSE=$(curl -sS -X GET \ + "https://git.asarius.site/api/v1/repos/rukira/wow-backup/releases/tags/${RELEASE_TAG}" \ + -H "Authorization: token ${FORGEJO_PAT}" \ + -H "Accept: application/json" || true) + RELEASE_ID=$(echo "$GET_RESPONSE" | jq -r '.id // empty') + fi + + if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" = "null" ]; then + echo "::error::Failed to create or find Forgejo release." + echo "Response: $CREATE_RESPONSE" + exit 1 + fi + + echo "Forgejo Release ID: ${RELEASE_ID}" + + for file in dist/*; do + [ -f "$file" ] || continue + filename=$(basename "$file") + echo "Uploading asset ${filename} to Forgejo release ${RELEASE_ID}..." + curl -sS --fail-with-body -X POST \ + "https://git.asarius.site/api/v1/repos/rukira/wow-backup/releases/${RELEASE_ID}/assets?name=${filename}" \ + -H "Authorization: token ${FORGEJO_PAT}" \ + -H "Accept: application/json" \ + -F "attachment=@${file}" + done + + echo "Forgejo release published successfully." diff --git a/docs/plans/feature-6-release-pipeline.md b/docs/plans/feature-6-release-pipeline.md index 4ae7d9b..aa978b9 100644 --- a/docs/plans/feature-6-release-pipeline.md +++ b/docs/plans/feature-6-release-pipeline.md @@ -3,7 +3,7 @@ **Status:** ✅ **Completed** ## Context -Automated multi-platform packaging and release pipeline for WoW Backup using GitHub Actions. Whenever changes are merged/pushed to the `main` branch, the pipeline calculates the next release version and tag, compiles native distributables for macOS, Windows, and Linux, and attaches all packaged binaries to a published GitHub Release. +Automated multi-platform packaging and release pipeline for WoW Backup using GitHub Actions. Whenever changes are merged/pushed to the `main` branch, the pipeline calculates the next release version and tag, compiles native distributables for macOS, Windows, and Linux, and attaches all packaged binaries to a published GitHub Release as well as a published Forgejo Release on `git.asarius.site` (`rukira/wow-backup`). ## Deliverables 1. **Dynamic Versioning in Gradle**: @@ -13,6 +13,7 @@ Automated multi-platform packaging and release pipeline for WoW Backup using Git - Automated semantic patch version computation and git tagging on push to `main` and `workflow_dispatch`. - Parallel runner matrix (`macos-latest`, `windows-latest`, `ubuntu-latest`) packaging `.dmg`, `.msi`, and `.deb`. - Automated GitHub Release creation with attached artifacts and release notes. + - Automated Forgejo Release creation on `git.asarius.site` (`rukira/wow-backup`) with attached distribution packages using `FORGEJO_PAT`. 3. **Installation Guide (`INSTALL.md`)**: - Detailed user installation guide for macOS (Gatekeeper bypass), Windows (SmartScreen bypass), and Linux (APT/DPKG). - Linked directly from `README.md`. From 21deba8c39a5e771abb60a8ca1d4eb63482f9143 Mon Sep 17 00:00:00 2001 From: Rukira Date: Mon, 24 Aug 2026 20:05:00 +0100 Subject: [PATCH 2/2] Fixing release job --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a31dc1a..5076c0e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -198,7 +198,8 @@ jobs: filename=$(basename "$file") echo "Uploading asset ${filename} to Forgejo release ${RELEASE_ID}..." curl -sS --fail-with-body -X POST \ - "https://git.asarius.site/api/v1/repos/rukira/wow-backup/releases/${RELEASE_ID}/assets?name=${filename}" \ + "https://git.asarius.site/api/v1/repos/rukira/wow-backup/releases/${RELEASE_ID}/assets" \ + --url-query "name=${filename}" \ -H "Authorization: token ${FORGEJO_PAT}" \ -H "Accept: application/json" \ -F "attachment=@${file}"