Compare commits
2
Commits
v0.3.8.1
...
7e335d14ef
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e335d14ef | ||
|
|
c8c2c98c8e |
No files matched your search
@@ -4,19 +4,38 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*.*.*'
|
- 'v*.*.*'
|
||||||
|
# Retry path: a tag push pins the workflow file to that tag's commit, so a
|
||||||
|
# re-run of a red release run replays the OLD workflow even after main is
|
||||||
|
# fixed (that is exactly how run 78 kept failing post-fix). Dispatching
|
||||||
|
# against main runs main's current workflow against any already-published
|
||||||
|
# tag, so a release can be re-published without moving a tag.
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
description: 'Existing tag to rebuild and re-publish, e.g. v0.3.8.1'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-release:
|
build-release:
|
||||||
name: Build & attach release APK
|
name: Build & attach release APK
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
|
env:
|
||||||
|
# The tag this run publishes: the tag itself on a push, or the typed
|
||||||
|
# input on a manual retry (where github.ref_name is just the branch).
|
||||||
|
RELEASE_TAG: ${{ github.event.inputs.tag || github.ref_name }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
run: |
|
run: |
|
||||||
git clone --depth=1 https://git.trevena.info/nick/incido.git repo
|
git clone --depth=1 https://git.trevena.info/nick/incido.git repo
|
||||||
cd repo
|
cd repo
|
||||||
|
# Targeted shallow fetch of the exact tag: the clone above is shallow
|
||||||
|
# off the default branch, so --tags alone may not carry the tag's
|
||||||
|
# commit when the run is dispatched from main instead of pushed.
|
||||||
|
git fetch --depth=1 origin tag "$RELEASE_TAG" || true
|
||||||
git fetch --tags origin
|
git fetch --tags origin
|
||||||
git checkout ${{ github.ref_name }}
|
git checkout "$RELEASE_TAG"
|
||||||
|
|
||||||
- name: Set up JDK 17
|
- name: Set up JDK 17
|
||||||
run: |
|
run: |
|
||||||
@@ -57,7 +76,7 @@ jobs:
|
|||||||
timeout-minutes: 25
|
timeout-minutes: 25
|
||||||
run: |
|
run: |
|
||||||
cd repo
|
cd repo
|
||||||
git checkout ${{ github.ref_name }}
|
git checkout "$RELEASE_TAG"
|
||||||
# Persistent signing keystore: minted ONCE in the runner's
|
# Persistent signing keystore: minted ONCE in the runner's
|
||||||
# cache dir (which survives across runs, same place the JDK
|
# cache dir (which survives across runs, same place the JDK
|
||||||
# and SDK live) and copied into the checkout. Every release
|
# and SDK live) and copied into the checkout. Every release
|
||||||
@@ -101,7 +120,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
cd repo
|
cd repo
|
||||||
TAG="${{ github.ref_name }}"
|
TAG="$RELEASE_TAG"
|
||||||
VERSION="${TAG#v}"
|
VERSION="${TAG#v}"
|
||||||
API="http://192.168.8.17:3000/api/v1/repos/nick/incido"
|
API="http://192.168.8.17:3000/api/v1/repos/nick/incido"
|
||||||
APK_DEBUG="Incido-$VERSION-debug.apk"
|
APK_DEBUG="Incido-$VERSION-debug.apk"
|
||||||
|
|||||||
@@ -522,6 +522,39 @@ adb install -r incido-<versionName>-debug.apk
|
|||||||
have to type it — `./gradlew assembleRelease` has already deposited
|
have to type it — `./gradlew assembleRelease` has already deposited
|
||||||
both stamped APKs at the repo root by the time you reach it.)
|
both stamped APKs at the repo root by the time you reach it.)
|
||||||
|
|
||||||
|
### 11.5 Re-running a failed release
|
||||||
|
|
||||||
|
**Never "Re-run" a red release run.** A tag push pins the workflow file to
|
||||||
|
that tag's own commit, so a re-run replays the workflow as it was when the
|
||||||
|
tag was cut — even after `main` has been fixed. It is also destructive: the
|
||||||
|
release step deletes each stale asset before re-uploading it, so a retry that
|
||||||
|
dies mid-step leaves the release with *fewer* assets than it started with.
|
||||||
|
(This is exactly what happened to v0.3.8.1 run 78, twice, over a `cp` bug
|
||||||
|
already patched on `main`.)
|
||||||
|
|
||||||
|
Instead, dispatch the workflow from `main`, which runs `main`'s current
|
||||||
|
workflow against an existing tag:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Gitea: POST .../actions/workflows/release.yml/dispatches (expect 204)
|
||||||
|
curl -s -X POST \
|
||||||
|
-H "Authorization: token $TOKEN" -H 'Content-Type: application/json' \
|
||||||
|
-d '{"ref":"main","inputs":{"tag":"v0.3.8.1"}}' \
|
||||||
|
http://192.168.8.17:3000/api/v1/repos/nick/incido/actions/workflows/release.yml/dispatches
|
||||||
|
```
|
||||||
|
|
||||||
|
Equivalently: Actions → "release" → Run workflow → branch `main` → tag input.
|
||||||
|
The job reuses the existing release entry, refreshes its description, and
|
||||||
|
re-attaches both APKs and `Incido-<version>-changes.md`.
|
||||||
|
|
||||||
|
Two API gotchas found the hard way: a run's **task id is not its run number**
|
||||||
|
(`GET /actions/runs/<n>/logs` 404s; logs live at
|
||||||
|
`GET /actions/jobs/<task-id>/logs`), and job logs echo the whole script before
|
||||||
|
executing it, so grep below the last `::endgroup::` to see real output.
|
||||||
|
|
||||||
|
If CI cannot attach the changelog file at all, `scripts/ci/backfill-release-notes.sh <version>`
|
||||||
|
patches description + notes asset after the fact (idempotent, never touches the APKs).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Appendix A — Key Library Versions (for the version catalog)
|
## Appendix A — Key Library Versions (for the version catalog)
|
||||||
|
|||||||
Reference in new issue
Block a user