Skip to content

Commit

Permalink
chore: update release process to allow RCs (#94)
Browse files Browse the repository at this point in the history
## Description

Update the release process to allow for RCs to publish to Homebrew

## Related Issue

Fixes #N/A

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [X] Other (security config, docs update, etc)

## Checklist before merging

- [X] Test, docs, adr added or updated as needed
- [X] [Contributor Guide
Steps](https://github.com/defenseunicorns/maru-runner/blob/main/CONTRIBUTING.md)
followed
  • Loading branch information
Racer159 committed May 22, 2024
1 parent 635060c commit 8cc002d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 13 deletions.
7 changes: 1 addition & 6 deletions .github/actions/save-logs/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ description: "Save debug logs"
runs:
using: composite
steps:
- name: Fix log permissions
run: |
sudo chown $USER /tmp/runner-*.log || echo ""
shell: bash

- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: debug-log
path: /tmp/runner-*.log
path: /tmp/maru-*.log
21 changes: 17 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ jobs:
run: |
chmod +x build/maru
- name: Run unit tests
run: |
make test-unit
- name: Run e2e tests
run: |
make test-e2e
Expand Down Expand Up @@ -90,13 +94,22 @@ jobs:
name: build-artifacts
path: build/

- name: Skip brew latest for pre-release tags
run: |
if [[ $GITHUB_REF_NAME == *"rc"* ]]; then
echo "BREW_NAME=maru@latest-rc" >> $GITHUB_ENV
else
echo "BREW_NAME=maru" >> $GITHUB_ENV
fi
- name: Get Brew tap repo token
id: brew-tap-token
uses: peter-murray/workflow-application-token-action@dc0413987a085fa17d19df9e47d4677cf81ffef3 # v3.0.0
uses: actions/create-github-app-token@f2acddfb5195534d487896a656232b016a682f3c # v1.9.0
with:
application_id: ${{ secrets.HOMEBREW_TAP_WORKFLOW_GITHUB_APP_ID }}
application_private_key: ${{ secrets.HOMEBREW_TAP_WORKFLOW_GITHUB_APP_SECRET }}
organization: defenseunicorns
app-id: ${{ secrets.HOMEBREW_TAP_WORKFLOW_GITHUB_APP_ID }}
private-key: ${{ secrets.HOMEBREW_TAP_WORKFLOW_GITHUB_APP_SECRET }}
owner: defenseunicorns
repositories: homebrew-tap

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
Expand Down
22 changes: 19 additions & 3 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,22 @@ changelog:
use: github-native

brews:
- name: maru
- name: "{{ .Env.BREW_NAME }}"
repository:
owner: defenseunicorns
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
branch: "{{ .ProjectName }}-{{ .Tag }}"
pull_request:
enabled: true
base:
branch: main
owner: defenseunicorns
name: homebrew-tap

commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}"
homepage: "https://github.com/defenseunicorns/maru-runner"
description: "CLI for Unicorn Delivery Service"
description: "The Unicorn Task Runner"

# NOTE: We are using .Version instead of .Tag because homebrew has weird semver parsing rules and won't be able to
# install versioned releases that has a `v` character before the version number.
Expand All @@ -60,9 +68,17 @@ brews:
owner: defenseunicorns
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
branch: "{{ .ProjectName }}-{{ .Tag }}"
pull_request:
enabled: true
base:
branch: main
owner: defenseunicorns
name: homebrew-tap

commit_msg_template: "Brew formula update for {{ .ProjectName }} versioned release {{ .Tag }}"
homepage: "https://github.com/defenseunicorns/maru-runner"
description: "unicorn-flavored build tool"
description: "The Unicorn Task Runner"

# Generate a GitHub release and publish the release for the tag
release:
Expand Down

0 comments on commit 8cc002d

Please sign in to comment.