Skip to content

Commit 40d5835

Browse files
authored
ci: publish concise kind-1 release announcement (#152)
1 parent b09267f commit 40d5835

3 files changed

Lines changed: 126 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ jobs:
199199
env:
200200
AGE_SECRET_KEY: ${{ secrets.AGE_SECRET_KEY }}
201201
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
202-
ZAPSTORE_SIGN_WITH: ${{ secrets.ZAPSTORE_SIGN_WITH }}
203202
run: |
204203
set -euo pipefail
205204
set +x
@@ -211,3 +210,38 @@ jobs:
211210
fi
212211
apk_path="$(find dist -maxdepth 1 -type f -name '*.apk' | head -n 1)"
213212
nix develop .#default -c ./scripts/zapstore-publish "$apk_path" "https://github.com/${GITHUB_REPOSITORY}"
213+
214+
announce-release:
215+
if: github.actor == 'justinmoon' || github.actor == 'futurepaul' || github.actor == 'AnthonyRonning' || github.actor == 'benthecarman'
216+
needs: publish
217+
runs-on: blacksmith-16vcpu-ubuntu-2404
218+
steps:
219+
- uses: actions/checkout@v4
220+
221+
- name: Ensure announcement signing secret exists
222+
run: |
223+
set -euo pipefail
224+
if [ ! -f secrets/zapstore-signing.env.age ]; then
225+
echo "error: missing secrets/zapstore-signing.env.age (required for release announcement signing)"
226+
exit 1
227+
fi
228+
229+
- uses: useblacksmith/stickydisk@v1
230+
with:
231+
key: ${{ github.repository }}-nix-v1-${{ runner.os }}
232+
path: /nix
233+
- name: Fix /nix ownership
234+
run: |
235+
if [ -d /nix ] && [ "$(stat -c %u /nix)" != "$(id -u)" ]; then
236+
sudo chown -R $(id -u):$(id -g) /nix
237+
fi
238+
- uses: nixbuild/nix-quick-install-action@v30
239+
240+
- name: Publish release announcement (kind 1)
241+
env:
242+
AGE_SECRET_KEY: ${{ secrets.AGE_SECRET_KEY }}
243+
run: |
244+
set -euo pipefail
245+
set +x
246+
repo_url="https://github.com/${GITHUB_REPOSITORY}"
247+
nix develop .#default -c ./scripts/post-release-announcement "${GITHUB_REF_NAME}" "$repo_url"

docs/release.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ This repo has three independent release pipelines, all tag-driven:
1414
|--------|------------|-------------|-----------|
1515
| Android APK | `v*` (e.g. `v0.2.2`) | `release.yml` | Signed APK + SHA256SUMS on GitHub Releases |
1616
| Zapstore publish | `v*` (e.g. `v0.2.2`) | `release.yml` (`publish-zapstore` job) | NIP-82 app/release/asset events on Zapstore relays |
17+
| Nostr announcement | `v*` (e.g. `v0.2.2`) | `release.yml` (`announce-release` job) | Kind-1 release announcement note |
1718
| marmotd (OpenClaw extension) | `marmotd-v*` (e.g. `marmotd-v0.3.2`) | `marmotd-release.yml` | Linux + macOS binaries on GitHub Releases, npm package |
1819

1920
**Important:** All release tags must be created from the `master` branch. Tags on
@@ -88,6 +89,9 @@ gh release view v0.3.0
8889
- Publish helper:
8990
- `./scripts/zapstore-publish <apk-path> [repo-url]`
9091
- used by both `just zapstore-publish` and CI to centralize secret handling
92+
- Release announcement helper:
93+
- `./scripts/post-release-announcement <tag> [repo-url] [zapstore-app-url]`
94+
- publishes concise kind-1 release announcements to popular relays
9195
- Optional for local hardware-key decrypt:
9296
- `PIKA_AGE_IDENTITY_FILE` (defaults to `~/configs/yubikeys/keys.txt`)
9397

@@ -116,6 +120,7 @@ Jobs:
116120
2. `build` - runs `just android-release`, uploads APK + `SHA256SUMS`
117121
3. `publish` - creates GitHub Release with uploaded assets
118122
4. `publish-zapstore` - publishes the built APK artifact to Zapstore relays
123+
5. `announce-release` - publishes a kind-1 release announcement (Zapstore + GitHub links)
119124

120125
`publish-zapstore` is gated on `secrets/zapstore-signing.env.age` existing in
121126
git. It decrypts `ZAPSTORE_SIGN_WITH` via `AGE_SECRET_KEY`, uses centralized

scripts/post-release-announcement

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
set +x
4+
5+
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
6+
DEFAULT_REPO_URL="https://github.com/sledtools/pika"
7+
DEFAULT_ZAPSTORE_APP_URL="https://zapstore.dev/app/com.justinmoon.pika"
8+
9+
usage() {
10+
cat <<'USAGE'
11+
usage: ./scripts/post-release-announcement <tag> [repo-url] [zapstore-app-url]
12+
13+
Publishes a kind-1 Nostr release announcement for a Git tag release.
14+
15+
Arguments:
16+
tag Release tag (e.g. v0.2.5)
17+
repo-url Optional repository URL (default: https://github.com/sledtools/pika)
18+
zapstore-app-url Optional Zapstore app URL (default: https://zapstore.dev/app/com.justinmoon.pika)
19+
20+
Environment:
21+
PIKA_ANNOUNCE_RELAYS Space-delimited relay list override
22+
USAGE
23+
}
24+
25+
need_cmd() {
26+
if ! command -v "$1" >/dev/null 2>&1; then
27+
echo "error: missing command: $1" >&2
28+
exit 1
29+
fi
30+
}
31+
32+
if [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ]; then
33+
usage
34+
exit 0
35+
fi
36+
37+
if [ "$#" -lt 1 ] || [ "$#" -gt 3 ]; then
38+
usage >&2
39+
exit 2
40+
fi
41+
42+
need_cmd nak
43+
need_cmd tr
44+
45+
tag="$1"
46+
repo_url="${2:-$DEFAULT_REPO_URL}"
47+
zapstore_app_url="${3:-$DEFAULT_ZAPSTORE_APP_URL}"
48+
49+
if ! printf '%s\n' "$tag" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+$'; then
50+
echo "error: invalid tag format: $tag (expected vX.Y.Z)" >&2
51+
exit 1
52+
fi
53+
54+
sign_with="$(cd "$ROOT" && ./scripts/read-zapstore-sign-with | tr -d '\r\n')"
55+
if [ -z "$sign_with" ]; then
56+
echo "error: decrypted Zapstore signing value is empty" >&2
57+
exit 1
58+
fi
59+
60+
if [ "${GITHUB_ACTIONS:-}" = "true" ]; then
61+
printf '::add-mask::%s\n' "$sign_with"
62+
fi
63+
64+
content="Pika Android ${tag} is live.
65+
Install on Zapstore: ${zapstore_app_url}
66+
GitHub release: ${repo_url}/releases/tag/${tag}"
67+
68+
if [ -n "${PIKA_ANNOUNCE_RELAYS:-}" ]; then
69+
IFS=' ' read -r -a relays <<<"${PIKA_ANNOUNCE_RELAYS}"
70+
else
71+
relays=(
72+
"wss://relay.primal.net"
73+
"wss://relay.damus.io"
74+
"wss://relay.zapstore.dev"
75+
"wss://nos.lol"
76+
"wss://relay.nostr.band"
77+
)
78+
fi
79+
80+
if [ "${#relays[@]}" -eq 0 ]; then
81+
echo "error: no relays configured for announcement" >&2
82+
exit 1
83+
fi
84+
85+
NOSTR_SECRET_KEY="$sign_with" nak -q event -k 1 -c "$content" "${relays[@]}"
86+
unset sign_with

0 commit comments

Comments
 (0)