ci: replace JS actions with shell steps — Flutter container has no Node

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.
This commit is contained in:
2026-03-12 00:21:47 -04:00
parent fa1b65484c
commit 3a336ddf88
+27 -10
View File
@@ -2,11 +2,16 @@
#
# Push to dev: analyze + test → build APK → upload artifact (fabledapp-dev-<sha>)
# 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/')