wharfy 0.18.0 — GitHub Actions からリリースできます

GitHub Actions からリリースできます

wharfy は途中で確認を求めません。端末も要りません。必要なトークンは環境変数から読みます。 手元で実行しているのと同じコマンドを、そのまま workflow に書けます。

- run: wharfy release --yes
- run: wharfy publish --yes

動かすのは、タグを push したときか、手動で実行したときです。

何を登録すればいいかは wharfy secrets が教えてくれます

必要なトークンはチャネルごとに違います。wharfy secrets を実行すると、いまの channels: に 何が要るかと、workflow への書き方が出ます。

$ wharfy secrets
credentials your channels need (wharfy reads them from the environment):
  ✗ GITHUB_TOKEN             container, homebrew, releases, script
    upload the release, write your tap/bucket, open gated PRs, push to ghcr

in a GitHub Actions workflow:
  permissions:
    contents: write
    packages: write
  env:
    GITHUB_TOKEN: ${{ secrets.WHARFY_GITHUB_TOKEN }}
  note: GITHUB_TOKEN must be a PAT (repo scope): homebrew writes to your homebrew tap repo — the token Actions hands the workflow can only write to this repository
✓ 1 credential(s) needed; 1 not set in this environment
next:
  gh secret set WHARFY_GITHUB_TOKEN # register for CI: GITHUB_TOKEN (upload the release, write your tap/bucket, open gated PRs, push to ghcr)

--json を付ければ、同じ内容が JSON で出ます。

tap や bucket に書くなら PAT が要ります

GitHub Actions が workflow に渡すトークンは、そのリポジトリにしか書き込めません。homebrew の tap も、scoop の bucket も、winget に出すときの fork も別のリポジトリなので、そこへ書くチャネルを 使うなら、権限のある PAT を登録しておく必要があります。どちらが要るかは secrets が判定します。

チャネル CI で要るもの
releases, script, goinstall Actions が渡すトークン + contents: write
container Actions が渡すトークン + packages: write
homebrew, cask, scoop, winget, homebrew-core PAT(repo 権限)
apt, rpm PACKAGE_REPO_TOKEN
aur AUR_SSH_KEY

macOS のバイナリに署名する構成なら、証明書(WHARFY_SIGN_P12)とそのパスワードも一覧に並びます。 このジョブには macOS のランナーが要ります。

直したこと

入れ方

brew upgrade wharfy / scoop update wharfy / go install github.com/ShiroDoromoto/wharfy/cmd/wharfy@latest。Linux は apt / yum リポジトリから。