From b8996ee52d8390b75165dc1d619a4698ae2a3871 Mon Sep 17 00:00:00 2001 From: Nima Kaviani <17132353+nimakaviani@users.noreply.github.com> Date: Wed, 22 Jan 2025 06:28:57 -0800 Subject: [PATCH] add configuration steps to create a brew release (#271) Signed-off-by: Nima Kaviani Co-authored-by: Charles Moulliard --- .github/workflows/release.yaml | 7 +++++++ .goreleaser.yaml | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c16e338c..cc6817a3 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -30,6 +30,12 @@ jobs: - name: build run: | OUT_FILE=/tmp/idpbuilder make build + - name: Generate a homebrew tap update token + id: generate-token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ vars.CNOE_HOMEBREW_APP_ID }} + private-key: ${{ secrets.CNOE_HOMEBREW_PRIVATE_KEY }} - name: GoReleaser uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0 id: run-goreleaser @@ -38,4 +44,5 @@ jobs: args: release --clean --timeout 30m env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HOMEBREW_TOKEN: ${{ steps.generate-token.outputs.token }} GORELEASER_CURRENT_TAG: ${{ github.ref_name }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 8cc9ca8c..043dcd73 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -26,6 +26,21 @@ builds: ignore: - goos: linux goarch: '386' +brews: + - name: idpbuilder + homepage: "https://cnoe.io" + repository: + owner: cnoe-io + name: homebrew-tap + token: "{{ .Env.HOMEBREW_TOKEN }}" + commit_author: + name: "CNOEAutomation" + email: "noreply@cnoe.io" + directory: formula + install: | + bin.install "idpbuilder" + test: | + system "#{bin}/idpbuilder --version" archives: - format: tar.gz name_template: >-