diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 194c91fc..fd8759dc 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -92,12 +92,22 @@ jobs: name: build-artifacts path: bin/ + - name: Get Brew tap repo token + id: brew-tap-token + uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0 + with: + app-id: ${{ secrets.HOMEBREW_TAP_WORKFLOW_GITHUB_APP_ID }} + private-key: ${{ secrets.HOMEBREW_TAP_WORKFLOW_GITHUB_APP_SECRET }} + owner: defenseunicorns + repositories: homebrew-tap + # Create the GitHub release notes - name: Run GoReleaser uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0 with: distribution: goreleaser version: latest - args: release --clean --verbose + args: release --clean --verbose --config .goreleaser.yaml env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}} + HOMEBREW_TAP_GITHUB_TOKEN: ${{ steps.brew-tap-token.outputs.token }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index adb5fe51..5ac2e9f2 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -42,6 +42,41 @@ snapshot: changelog: use: github-native +brews: + - name: lula + 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/lula" + description: "The Compliance Validator" + + # 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. + - name: "lula@{{ .Version }}" + 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 }} versioned release {{ .Tag }}" + homepage: "https://github.com/defenseunicorns/lula" + description: "The Compliance Validator" + # Generate a GitHub release and publish the release for the tag release: github: