Merge pull request 'ci: replace JS actions with shell steps — Flutter container has no Node' (#2) from dev into main

Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
2026-03-12 00:23:06 -04:00
+27 -10
View File
@@ -2,11 +2,16 @@
# #
# Push to dev: analyze + test → build APK → upload artifact (fabledapp-dev-<sha>) # Push to dev: analyze + test → build APK → upload artifact (fabledapp-dev-<sha>)
# Push to main: analyze + test only (no build — wait for release tag) # 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 # Pull request: analyze + test only
# #
# To cut a release: # 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): # Required secrets (repo → Settings → Secrets → Actions):
# RELEASE_TOKEN — Forgejo PAT with write:repository scope # RELEASE_TOKEN — Forgejo PAT with write:repository scope
@@ -41,7 +46,10 @@ jobs:
container: container:
image: ghcr.io/cirruslabs/flutter:stable image: ghcr.io/cirruslabs/flutter:stable
steps: steps:
- uses: actions/checkout@v6 - name: Checkout
run: |
git clone "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" .
git checkout "$GITHUB_SHA"
- name: Install dependencies - name: Install dependencies
run: flutter pub get run: flutter pub get
@@ -65,7 +73,10 @@ jobs:
container: container:
image: ghcr.io/cirruslabs/flutter:stable image: ghcr.io/cirruslabs/flutter:stable
steps: steps:
- uses: actions/checkout@v6 - name: Checkout
run: |
git clone "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" .
git checkout "$GITHUB_SHA"
- name: Install dependencies - name: Install dependencies
run: flutter pub get run: flutter pub get
@@ -82,12 +93,18 @@ jobs:
echo "name=fabledapp-${{ github.sha }}" >> $GITHUB_OUTPUT echo "name=fabledapp-${{ github.sha }}" >> $GITHUB_OUTPUT
fi fi
- name: Upload artifact - name: Upload artifact to Forgejo
uses: actions/upload-artifact@v6 env:
with: RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
name: ${{ steps.artifact.outputs.name }} APK: build/app/outputs/flutter-apk/app-release.apk
path: build/app/outputs/flutter-apk/app-release.apk API: https://git.fabledsword.com/api/v1/repos/bvandeusen/FabledApp
retention-days: 30 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 - name: Publish Forgejo release
if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')