diff --git a/.gitea/workflows/BuildAndroid.yml b/.gitea/workflows/BuildAndroid.yml index da26ee0..983b5d4 100644 --- a/.gitea/workflows/BuildAndroid.yml +++ b/.gitea/workflows/BuildAndroid.yml @@ -29,11 +29,18 @@ jobs: - name: Checkout uses: https://github.com/actions/checkout@v4 - # The flutter tool runs git inside the workspace, which the container - # user does not own after the checkout. + # The flutter tool runs git inside the workspace and inside its own sdk, + # and git refuses to work in directories it considers to belong to + # somebody else. - name: Trust the workspace run: git config --global --add safe.directory '*' + # Everything the flutter download below needs. + - name: Install the download tools + run: | + apt-get update + apt-get install -y --no-install-recommends ca-certificates curl xz-utils + - name: Set up Java uses: https://github.com/actions/setup-java@v4 with: @@ -47,12 +54,19 @@ jobs: - name: Set up the Android sdk uses: https://github.com/android-actions/setup-android@v3 + # `subosito/flutter-action` cannot be used: it caches the sdk through + # `actions/cache@v5`, and the act-runner of this gitea instance only + # supports actions up to node20 ("runs.using ... got node24"). Unpacking + # the official archive does the same thing and pins the version exactly, + # just like `ac_web/Dockerfile` does. - name: Set up Flutter - uses: https://github.com/subosito/flutter-action@v2 - with: - flutter-version: ${{ env.FLUTTER_VERSION }} - channel: stable - cache: true + run: | + curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${{ env.FLUTTER_VERSION }}-stable.tar.xz" \ + | tar -xJ -C /opt + echo "/opt/flutter/bin" >> "$GITHUB_PATH" + + - name: Show the flutter version + run: flutter --version - name: Install dependencies run: flutter pub get diff --git a/.gitea/workflows/BuildLinux.yml b/.gitea/workflows/BuildLinux.yml index 86ca983..0089974 100644 --- a/.gitea/workflows/BuildLinux.yml +++ b/.gitea/workflows/BuildLinux.yml @@ -28,8 +28,9 @@ jobs: - name: Checkout uses: https://github.com/actions/checkout@v4 - # The flutter tool runs git inside the workspace, which the container - # user does not own after the checkout. + # The flutter tool runs git inside the workspace and inside its own sdk, + # and git refuses to work in directories it considers to belong to + # somebody else. - name: Trust the workspace run: git config --global --add safe.directory '*' @@ -42,12 +43,19 @@ jobs: libgtk-3-dev liblzma-dev libstdc++-12-dev \ curl unzip xz-utils + # `subosito/flutter-action` cannot be used: it caches the sdk through + # `actions/cache@v5`, and the act-runner of this gitea instance only + # supports actions up to node20 ("runs.using ... got node24"). Unpacking + # the official archive does the same thing and pins the version exactly, + # just like `ac_web/Dockerfile` does. - name: Set up Flutter - uses: https://github.com/subosito/flutter-action@v2 - with: - flutter-version: ${{ env.FLUTTER_VERSION }} - channel: stable - cache: true + run: | + curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${{ env.FLUTTER_VERSION }}-stable.tar.xz" \ + | tar -xJ -C /opt + echo "/opt/flutter/bin" >> "$GITHUB_PATH" + + - name: Show the flutter version + run: flutter --version - name: Install dependencies run: flutter pub get diff --git a/CLAUDE.md b/CLAUDE.md index 550a298..8caed07 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -44,6 +44,7 @@ Widget tests run against a mocked backend: build a `MockClient` that answers by Notes that are easy to get wrong: +- **The act-runner of the gitea instance only supports actions up to `node20`.** Anything newer fails with `The runs.using key in action.yml must be one of: [...], got node24`, which is why the Flutter sdk is unpacked from the official archive instead of through `subosito/flutter-action` (that one caches through `actions/cache@v5`). Check the `runs.using` of an action before adding it. - The Flutter version is pinned in three places (`FLUTTER_VERSION` in both build workflows, `ARG FLUTTER_VERSION` in `ac_web/Dockerfile`) and must be kept in sync. - Steps run with `working-directory: ac_web`, but `upload-artifact` paths are relative to the repository root. - The workflows are read from the tag the release points at, so they have to be committed **before** the release is created.