Skip to content

Commit 42b8ada

Browse files
committed
ci: use releaser app for v2 publishing
1 parent 6069f3c commit 42b8ada

3 files changed

Lines changed: 22 additions & 9 deletions

File tree

.github/workflows/docs-site.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
name: Docs Site
22

33
on:
4+
push:
5+
tags:
6+
- "v*"
47
workflow_dispatch:
58

6-
# Automatic push and pull request triggers are intentionally omitted while the
7-
# v2 docs site is unreleased. Before release, configure Pages to use GitHub
8-
# Actions, set DOCS_SITE_DEPLOY_ENABLED=true in repository variables, and add
9-
# the desired push trigger.
9+
# Branch push and pull request triggers are intentionally omitted. Version tags
10+
# keep docs in step with stable builds, and workflow_dispatch lets maintainers
11+
# publish small main-branch docs edits without waiting for another release.
1012

1113
permissions:
1214
contents: read

.github/workflows/release.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,21 @@ jobs:
2929
- name: Test
3030
run: go test ./...
3131

32+
- name: Generate Homebrew tap token
33+
id: releaser-token
34+
uses: actions/create-github-app-token@v2
35+
with:
36+
app-id: ${{ secrets.RELEASER_APP_ID }}
37+
private-key: ${{ secrets.RELEASER_APP_PRIVATE_KEY }}
38+
repositories: |
39+
homebrew-tap
40+
restish
41+
3242
- name: Check out Homebrew tap
3343
uses: actions/checkout@v5
3444
with:
3545
repository: rest-sh/homebrew-tap
36-
token: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
46+
token: ${{ steps.releaser-token.outputs.token }}
3747
path: homebrew-tap
3848

3949
- name: Ensure v1 Homebrew formula
@@ -60,4 +70,4 @@ jobs:
6070
release --clean --parallelism 4
6171
env:
6272
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63-
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
73+
HOMEBREW_TAP_GITHUB_TOKEN: ${{ steps.releaser-token.outputs.token }}

docs/release-packaging.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ formula without fighting for the same linked executable.
6060
brew install rest-sh/tap/restish@1
6161
```
6262

63-
The release workflow expects `HOMEBREW_TAP_GITHUB_TOKEN` to have write access to
64-
`rest-sh/homebrew-tap`. GoReleaser uses it to update v2 formulae, and the
65-
workflow seeds the v1 formula from `packaging/homebrew/restish@1.rb`.
63+
The release workflow uses the existing Restish Releaser GitHub App secrets
64+
(`RELEASER_APP_ID` and `RELEASER_APP_PRIVATE_KEY`) to mint a short-lived token
65+
with access to `rest-sh/homebrew-tap`. GoReleaser uses it to update v2 formulae,
66+
and the workflow seeds the v1 formula from `packaging/homebrew/restish@1.rb`.
6667

6768
## First-Party Plugin Artifacts
6869

0 commit comments

Comments
 (0)