Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
# GitHub considers creating releases and uploading assets as writing contents.
permissions:
contents: write
issues: write

jobs:
goreleaser:
Expand Down Expand Up @@ -72,18 +73,41 @@ jobs:
AUTHKEY_BASE64: ${{ secrets.APPLE_API_KEY }}
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v3


- name: Ensure tap fork exists
run: |
# Create fork with suffix `-fork` to indicate that the repo in the technical users account is just a fork
gh repo fork stackitcloud/homebrew-tap \
--fork-name homebrew-tap-fork \
Comment thread
rubenhoenle marked this conversation as resolved.
Resolved
--clone=false || true
env:
GH_TOKEN: ${{ secrets.CLI_RELEASE }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7.3.0
with:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.CLI_RELEASE }}
# GITHUB_TOKEN is used to create the GitHub release in this repository.
# It uses the workflow-level permissions defined above.
GITHUB_TOKEN: ${{ github.token }}
Comment thread
marceljk marked this conversation as resolved.
Resolved
# HOMEBREW_RELEASE_TOKEN is a PAT belonging to the `stackit-pipeline` user.
# It is used by GoReleaser to push to the tap fork and open the upstream Homebrew PR.
HOMEBREW_RELEASE_TOKEN: ${{ secrets.CLI_RELEASE }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GPG_KEY_PATH: ${{ env.GPG_KEY_PATH }}
# nfpm-rpm signing needs this env to be set.
NFPM_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

- name: Create issue to inform about Homebrew PR
run: |
gh issue create \
--repo "${{ github.repository }}" \
--title "Homebrew Cask PR opened for ${{ github.ref_name }}" \
--body "A pull request has been automatically created for release **${{ github.ref_name }}**"
env:
GH_TOKEN: ${{ github.token }}

- name: Clean up GPG key file
if: always()
run: |
Expand Down
13 changes: 11 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,17 @@ homebrew_casks:
- name: stackit
directory: Casks
repository:
owner: stackitcloud
name: homebrew-tap
# Update of the homebrew cask is created via a fork of the homebrew tap
owner: stackit-pipeline
name: homebrew-tap-fork
Comment thread
rubenhoenle marked this conversation as resolved.
Resolved
token: "{{ .Env.HOMEBREW_RELEASE_TOKEN }}"
branch: "{{.ProjectName}}-{{.Version}}"
pull_request:
enabled: true
base:
owner: stackitcloud
name: homebrew-tap
branch: main
commit_author:
name: CLI Release Bot
email: noreply@stackit.de
Expand Down
Loading