Skip to content

Commit b058585

Browse files
Automate PR Creation in Release Workflow (#1158)
* Updated Release Workflow * Updated Release Workflow * Updated Release Workflow
1 parent 4c7b8db commit b058585

File tree

2 files changed

+54
-17
lines changed

2 files changed

+54
-17
lines changed

.github/workflows/release.yml

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ jobs:
1616
uses: actions/checkout@v3
1717
with:
1818
fetch-depth: 0 # This ensures all history and tags are fetched
19+
path: auth0-cli
1920

2021
- name: Set up Go
2122
uses: actions/setup-go@v3
2223
with:
23-
go-version-file: go.mod
24+
go-version-file: auth0-cli/go.mod
2425
check-latest: true
2526

2627
- name: Import GPG key
@@ -32,12 +33,62 @@ jobs:
3233
git_user_signingkey: true
3334
git_commit_gpgsign: true
3435
git_tag_gpgsign: true
36+
git_committer_email: auth0-cli-cd-sa@okta.com
37+
git_committer_name: auth0
3538

3639
- name: Run GoReleaser
3740
uses: goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3 # pin@6.2.1
3841
with:
3942
version: "2.7.0"
4043
args: release --clean
44+
workdir: 'auth0-cli'
4145
env:
4246
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
4347
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
48+
49+
# Homebrew Tap Process
50+
- name: Checkout Homebrew Tap Repo
51+
uses: actions/checkout@v3
52+
with:
53+
repository: auth0/homebrew-auth0-cli
54+
token: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
55+
path: homebrew-auth0-cli
56+
57+
- name: Copy Brew Formula
58+
run: |
59+
cp auth0-cli/dist/homebrew/*.rb homebrew-auth0-cli/
60+
61+
- name: Create Homebrew Pull Request
62+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # pin@7.0.8
63+
with:
64+
token: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
65+
commit-message: "Brew formula update for auth0-cli version ${{ github.ref_name }}"
66+
branch: ${{ github.ref_name }}
67+
title: "Brew formula update for auth0-cli version ${{ github.ref_name }}"
68+
body: "This PR updates the Homebrew formula for version ${{ github.ref_name }}."
69+
base: main
70+
committer: auth0 <auth0-cli-cd-sa@okta.com>
71+
path: homebrew-auth0-cli
72+
73+
# Scoop Manifest Process
74+
- name: Checkout Scoop Repo
75+
uses: actions/checkout@v3
76+
with:
77+
repository: auth0/scoop-auth0-cli
78+
token: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
79+
path: scoop-auth0-cli
80+
81+
- name: Copy Scoop Manifest
82+
run: |
83+
cp auth0-cli/dist/scoop/*.json scoop-auth0-cli/
84+
- name: Create Scoop Pull Request
85+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # pin@7.0.8
86+
with:
87+
token: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
88+
commit-message: "Scoop manifest update for auth0-cli version ${{ github.ref_name }}"
89+
branch: ${{ github.ref_name }}
90+
title: "Scoop manifest update for auth0-cli version ${{ github.ref_name }}"
91+
body: "This PR updates the Scoop manifest for version ${{ github.ref_name }}."
92+
base: main
93+
committer: auth0 <auth0-cli-cd-sa@okta.com>
94+
path: scoop-auth0-cli

.goreleaser.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ brews:
3737
repository:
3838
owner: auth0
3939
name: homebrew-auth0-cli
40-
branch: main
41-
pull_request:
42-
enabled: true
43-
base:
44-
owner: auth0
45-
name: homebrew-auth0-cli
46-
branch: main
4740
token: "{{ .Env.GITHUB_TOKEN }}"
4841
commit_author:
4942
name: auth0
@@ -52,7 +45,7 @@ brews:
5245
homepage: https://auth0.github.io/auth0-cli
5346
description: Build, manage and test your Auth0 integrations from the command line
5447
license: MIT
55-
skip_upload: auto
48+
skip_upload: true
5649
install: |
5750
bin.install "auth0"
5851
@@ -66,13 +59,6 @@ scoops:
6659
repository:
6760
owner: auth0
6861
name: scoop-auth0-cli
69-
branch: main
70-
pull_request:
71-
enabled: true
72-
base:
73-
owner: auth0
74-
name: scoop-auth0-cli
75-
branch: main
7662
token: "{{ .Env.GITHUB_TOKEN }}"
7763
commit_author:
7864
name: auth0
@@ -81,5 +67,5 @@ scoops:
8167
homepage: https://auth0.github.io/auth0-cli
8268
description: Build, manage and test your Auth0 integrations from the command line
8369
license: MIT
84-
skip_upload: auto
70+
skip_upload: true
8571
post_install: ["Write-Host 'Thanks for installing the Auth0 CLI'"]

0 commit comments

Comments
 (0)