Skip to content

Commit bf92184

Browse files
committed
fix(release): pass HOMEBREW_DEPLOY_KEY secret to goreleaser
Add homebrew_deploy_key input to go-build-release action and pass it from on-tag workflow. Skip upload gracefully when key is not set.
1 parent f8d614a commit bf92184

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

.github/actions/go-build-release/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ inputs:
2424
description: 'ko version (e.g. v0.18.0)'
2525
required: false
2626
default: 'v0.18.0'
27+
homebrew_deploy_key:
28+
description: 'SSH deploy key for pushing Homebrew formula'
29+
required: false
30+
default: ''
2731

2832
outputs:
2933
release_outcome:
@@ -52,6 +56,7 @@ runs:
5256
env:
5357
GITHUB_TOKEN: ${{ github.token }}
5458
GOFLAGS: -mod=vendor
59+
HOMEBREW_DEPLOY_KEY: ${{ inputs.homebrew_deploy_key }}
5560
# Repository paths are fully specified in .goreleaser.yaml kos.repositories
5661
run: |
5762
set -euo pipefail

.github/workflows/on-tag.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ jobs:
8989
uses: ./.github/actions/go-build-release
9090
with:
9191
ko_version: ${{ steps.versions.outputs.ko }}
92+
homebrew_deploy_key: ${{ secrets.HOMEBREW_DEPLOY_KEY }}
9293

9394
- name: Malware Scan Release Binaries
9495
if: steps.release.outcome == 'success'

.goreleaser.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ brews:
170170
git:
171171
url: "ssh://git@github.com/NVIDIA/homebrew-aicr.git"
172172
private_key: "{{ .Env.HOMEBREW_DEPLOY_KEY }}"
173+
skip_upload: "{{ if .Env.HOMEBREW_DEPLOY_KEY }}false{{ else }}true{{ end }}"
173174
commit_author:
174175
name: github-actions
175176
email: github-actions@github.com

0 commit comments

Comments
 (0)