From 483987461d770dbb051b837f05fd67bb0b39045c Mon Sep 17 00:00:00 2001 From: Nima Kaviani Date: Sat, 1 Jun 2024 21:55:46 -0700 Subject: [PATCH 1/3] add configuration steps to create a brew release Signed-off-by: Nima Kaviani --- .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 5f3d72b5..ca61db15 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -22,6 +22,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 @@ -30,3 +36,4 @@ jobs: args: release --clean --timeout 30m env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HOMEBREW_TOKEN: ${{ steps.generate-token.outputs.token }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index b13a558f..0296a5f6 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -20,6 +20,21 @@ builds: ignore: - goos: linux goarch: '386' +brews: + - name: idpbuilder + homepage: "https://cnoe.io" + repository: + owner: nimakaviani + name: homebrew-cnoe + token: "{{ .Env.HOMEBREW_TOKEN }}" + commit_author: + name: "GoReleaser" + email: "noreply@goreleaser.com" + directory: formula + install: | + bin.install "idpbuilder" + test: | + system "#{bin}/idpbuilder --version" archives: - format: tar.gz name_template: >- From be10a5d248b7194da78758caa733d71f1dd667be Mon Sep 17 00:00:00 2001 From: Nima Kaviani Date: Sun, 2 Jun 2024 21:16:00 -0700 Subject: [PATCH 2/3] fix the owner name and the repo name for the tap Signed-off-by: Nima Kaviani --- .goreleaser.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 0296a5f6..9acb1a8b 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -24,8 +24,8 @@ brews: - name: idpbuilder homepage: "https://cnoe.io" repository: - owner: nimakaviani - name: homebrew-cnoe + owner: cnoe-io + name: homebrew-tap token: "{{ .Env.HOMEBREW_TOKEN }}" commit_author: name: "GoReleaser" From bc52d326521baa4523a50123169f5038361cc374 Mon Sep 17 00:00:00 2001 From: Nima Kaviani Date: Mon, 3 Jun 2024 14:45:46 -0700 Subject: [PATCH 3/3] fix the commit author name for the bot Signed-off-by: Nima Kaviani --- .goreleaser.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 9acb1a8b..fa06803b 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -28,8 +28,8 @@ brews: name: homebrew-tap token: "{{ .Env.HOMEBREW_TOKEN }}" commit_author: - name: "GoReleaser" - email: "noreply@goreleaser.com" + name: "CNOEAutomation" + email: "noreply@cnoe.io" directory: formula install: | bin.install "idpbuilder"