prod-pins/.forgejo/workflows/canary.yml
Alois 123205c97d
Some checks failed
action.yml / Centralize Tensamin packages modules and release automation (push) Failing after 0s
Canary release / release (push) Failing after 21s
Centralize Tensamin packages modules and release automation
2026-10-04 19:19:56 +02:00

85 lines
4.6 KiB
YAML

name: Canary release
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: tensamin-central-releases
cancel-in-progress: false
jobs:
release:
runs-on: nixos
env:
NIX_CONFIG: experimental-features = nix-command flakes
FORGEJO_SERVER_URL: ${{ forgejo.server_url }}
FORGEJO_REPOSITORY: ${{ forgejo.repository }}
FORGEJO_RUN_ID: ${{ forgejo.run_id }}
RELEASE_CHANNEL: canary
RELEASE_TOKEN: ${{ secrets.TENSAMIN_RELEASE_TOKEN }}
FORGEJO_REGISTRY_USER: ${{ vars.FORGEJO_REGISTRY_USER }}
IOTA_RELEASE_SIGNING_KEY: ${{ secrets.IOTA_RELEASE_SIGNING_KEY }}
IOTA_RELEASE_PUBLIC_KEY: ${{ vars.IOTA_RELEASE_PUBLIC_KEY }}
IOTA_RELEASE_SIGNING_KEY_ID: ${{ vars.IOTA_RELEASE_SIGNING_KEY_ID || 'primary' }}
IOTA_BASE_VERSION: ${{ vars.IOTA_BASE_VERSION || '0.1.0' }}
TENSAMIN_SSH_KNOWN_HOSTS: ${{ vars.TENSAMIN_SSH_KNOWN_HOSTS }}
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
ANDROID_STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }}
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Bootstrap pinned tools and source credentials
uses: ./.forgejo/workflows/source-access
with:
source-key: ${{ secrets.TENSAMIN_SOURCE_SSH_KEY }}
known-hosts: ${{ vars.TENSAMIN_SSH_KNOWN_HOSTS }}
- name: Set immutable release identity
run: |
set -euo pipefail
printf 'RELEASE_SEQUENCE=%s\nRELEASE_TAG=canary-%s-%s\n' "$(date +%s)" "$(git rev-parse HEAD)" "$FORGEJO_RUN_ID" >> "$GITHUB_ENV"
- name: Check central release scripts
run: |
set -euo pipefail
nix develop --impure --expr "import $PWD/scripts/release-env.nix { root = builtins.toPath \"$PWD\"; }" --command shellcheck scripts/release-build.sh scripts/release-client.sh
nix develop --impure --expr "import $PWD/scripts/release-env.nix { root = builtins.toPath \"$PWD\"; }" --command ruff check scripts/release.py scripts/deploy-release.py
- name: Validate and build all central packages and client assets
run: |
nix develop --impure --expr "import $PWD/scripts/release-env.nix { root = builtins.toPath \"$PWD\"; }" --command bash scripts/release-build.sh "$RELEASE_CHANNEL" release-out
- name: Attempt aarch64 build with available builders
run: |
set -euo pipefail
if ! nix develop --impure --expr "import $PWD/scripts/release-env.nix { root = builtins.toPath \"$PWD\"; }" --command bash scripts/release-build.sh "$RELEASE_CHANNEL" release-arm aarch64-linux > arm-build.log 2>&1; then
printf 'aarch64 unavailable. See the attached arm-build.log.\n' > release-out/aarch64-unavailable.txt
cp arm-build.log release-out/
else
cp release-arm/*linux-aarch64* release-out/
cp release-arm/*arm64* release-out/
cp release-arm/electron-release-metadata-aarch64.json release-out/
fi
- name: Sign manifests and validate installer bundles
run: |
set -euo pipefail
nix develop --impure --expr "import $PWD/scripts/release-env.nix { root = builtins.toPath \"$PWD\"; }" --command python3 scripts/release.py sign --channel "$RELEASE_CHANNEL" --tag "$RELEASE_TAG"
nix develop --impure --expr "import $PWD/scripts/release-env.nix { root = builtins.toPath \"$PWD\"; }" --command python3 scripts/release.py provenance --channel "$RELEASE_CHANNEL" --tag "$RELEASE_TAG"
- name: Preserve combined build artifacts
uses: https://data.forgejo.org/actions/upload-artifact@v3
with:
name: combined-release
path: release-out/
- name: Stage and verify draft attachments
run: |
nix develop --impure --expr "import $PWD/scripts/release-env.nix { root = builtins.toPath \"$PWD\"; }" --command python3 scripts/release.py stage --channel "$RELEASE_CHANNEL" --tag "$RELEASE_TAG"
- name: Publish canary and update channel pointers
run: |
nix develop --impure --expr "import $PWD/scripts/release-env.nix { root = builtins.toPath \"$PWD\"; }" --command python3 scripts/release.py publish --channel canary --tag "$RELEASE_TAG"
- name: Remove source credentials
if: always()
run: |
if [[ -n ${SSH_AGENT_PID:-} ]]; then kill "$SSH_AGENT_PID"; fi
rm -rf "$RUNNER_TEMP/tensamin-source"