From 09d7c2064fa922df849ee7a64d2441c772a8161a Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Mar 2026 21:52:21 -0700 Subject: [PATCH] Add release job to Gitea Actions workflow Creates a pre-release with all platform artifacts on every push to main. Uses BUILD_TOKEN secret for Gitea API authentication. Co-Authored-By: Claude Opus 4.6 (1M context) --- .gitea/workflows/build.yml | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 92000a5..bc9e21a 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -134,3 +134,46 @@ jobs: src-tauri/target/release/bundle/dmg/*.dmg src-tauri/target/release/bundle/macos/*.app retention-days: 30 + + release: + name: Create Release + needs: build-tauri + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Download all app artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts/ + pattern: app-* + + - name: Generate release tag + id: tag + run: echo "tag=build-$(date +%Y%m%d-%H%M%S)" >> $GITHUB_OUTPUT + + - name: Create release + env: + BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }} + TAG: ${{ steps.tag.outputs.tag }} + run: | + # Create the release + RELEASE_ID=$(curl -s -X POST \ + -H "Authorization: token ${BUILD_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "{\"tag_name\": \"${TAG}\", \"name\": \"Voice to Notes ${TAG}\", \"body\": \"Automated build from main branch.\", \"draft\": false, \"prerelease\": true}" \ + "${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}/releases" | jq -r '.id') + + echo "Release ID: ${RELEASE_ID}" + + # Upload all artifacts + find artifacts/ -type f \( -name "*.deb" -o -name "*.AppImage" -o -name "*.msi" -o -name "*.exe" -o -name "*.dmg" \) | while read file; do + filename=$(basename "$file") + echo "Uploading ${filename}..." + curl -s -X POST \ + -H "Authorization: token ${BUILD_TOKEN}" \ + -H "Content-Type: application/octet-stream" \ + --data-binary "@${file}" \ + "${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=${filename}" + done