From 3a336ddf88fe25ae8cc1b921a724118663c11188 Mon Sep 17 00:00:00 2001 From: bvandeusen Date: Thu, 12 Mar 2026 00:21:47 -0400 Subject: [PATCH] =?UTF-8?q?ci:=20replace=20JS=20actions=20with=20shell=20s?= =?UTF-8?q?teps=20=E2=80=94=20Flutter=20container=20has=20no=20Node?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit actions/checkout and actions/upload-artifact are JavaScript actions. When container: is set, act runs them inside the container (not on the host runner), but ghcr.io/cirruslabs/flutter:stable has no Node.js. Replace both with equivalent shell commands: - checkout: git clone + git checkout SHA - artifact upload: curl to Forgejo API (best-effort, non-blocking) The release APK attach step was already a pure shell step and is unchanged. --- .forgejo/workflows/ci.yml | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 50ead4e..62cfa39 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -2,11 +2,16 @@ # # Push to dev: analyze + test → build APK → upload artifact (fabledapp-dev-) # Push to main: analyze + test only (no build — wait for release tag) -# Tag v26.03.11: analyze + test → build APK → upload artifact + create Forgejo Release +# Tag v*: analyze + test → build APK → upload artifact + attach to Forgejo Release # Pull request: analyze + test only # # To cut a release: -# git tag v26.03.11 && git push origin v26.03.11 +# Create a release via the Forgejo UI on main with a v* tag name. +# The tag push triggers this workflow; the build job attaches the APK. +# +# Note: JavaScript actions (actions/checkout, actions/upload-artifact) cannot run +# inside the Flutter container because it has no Node.js. All steps use shell +# commands directly instead. # # Required secrets (repo → Settings → Secrets → Actions): # RELEASE_TOKEN — Forgejo PAT with write:repository scope @@ -41,7 +46,10 @@ jobs: container: image: ghcr.io/cirruslabs/flutter:stable steps: - - uses: actions/checkout@v6 + - name: Checkout + run: | + git clone "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" . + git checkout "$GITHUB_SHA" - name: Install dependencies run: flutter pub get @@ -65,7 +73,10 @@ jobs: container: image: ghcr.io/cirruslabs/flutter:stable steps: - - uses: actions/checkout@v6 + - name: Checkout + run: | + git clone "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" . + git checkout "$GITHUB_SHA" - name: Install dependencies run: flutter pub get @@ -82,12 +93,18 @@ jobs: echo "name=fabledapp-${{ github.sha }}" >> $GITHUB_OUTPUT fi - - name: Upload artifact - uses: actions/upload-artifact@v6 - with: - name: ${{ steps.artifact.outputs.name }} - path: build/app/outputs/flutter-apk/app-release.apk - retention-days: 30 + - name: Upload artifact to Forgejo + env: + RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }} + APK: build/app/outputs/flutter-apk/app-release.apk + API: https://git.fabledsword.com/api/v1/repos/bvandeusen/FabledApp + ARTIFACT_NAME: ${{ steps.artifact.outputs.name }} + run: | + # Upload the APK as a workflow artifact via the Forgejo API. + curl -s -X POST "$API/actions/artifacts" \ + -H "Authorization: token $RELEASE_TOKEN" \ + -F "name=$ARTIFACT_NAME" \ + -F "file=@$APK" || echo "Artifact upload skipped (API may not support this endpoint)." - name: Publish Forgejo release if: startsWith(github.ref, 'refs/tags/')