Skip to content

Commit 478bd50

Browse files
committed
Update Homebrew Tap when releasing
Closes gh-40424
1 parent 19481bb commit 478bd50

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Update Homebrew Tap
2+
description: Updates the Homebrew Tap for the Spring Boot CLI
3+
inputs:
4+
spring-boot-version:
5+
description: 'The version to publish'
6+
required: true
7+
token:
8+
description: 'Token to use for GitHub authentication'
9+
required: true
10+
runs:
11+
using: composite
12+
steps:
13+
- name: Check Out Homebrew Tap Repo
14+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
15+
with:
16+
path: updated-homebrew-tap-repo
17+
repository: spring-io/homebrew-tap
18+
token: ${{ inputs.token }}
19+
- shell: bash
20+
- run: |
21+
pushd updated-homebrew-tap-repo > /dev/null
22+
curl https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-cli/${{ inputs.spring-boot-version }}/spring-boot-cli-${{ inputs.spring-boot-version }}-homebrew.rb --output spring-boot-cli-${{ inputs.spring-boot-version }}-homebrew.rb
23+
rm spring-boot.rb
24+
mv spring-boot-cli-*.rb spring-boot.rb
25+
git config user.name "Spring Builds" > /dev/null
26+
git config user.email "spring-builds@users.noreply.github.com" > /dev/null
27+
git add spring-boot.rb > /dev/null
28+
git commit -m "Upgrade to Spring Boot ${{ inputs.spring-boot-version }}" > /dev/null
29+
git push
30+
echo "DONE"
31+
popd > /dev/null

.github/workflows/release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,28 @@ jobs:
105105
sdkman-consumer-key: ${{ secrets.SDKMAN_CONSUMER_KEY }}
106106
sdkman-consumer-token: ${{ secrets.SDKMAN_CONSUMER_TOKEN }}
107107
spring-boot-version: ${{ needs.build-and-stage-release.outputs.version }}
108+
update-homebrew-tap:
109+
name: Update Homebrew Tap
110+
needs:
111+
- build-and-stage-release
112+
- sync-to-maven-central
113+
runs-on: ubuntu-latest
114+
steps:
115+
- name: Check Out Code
116+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
117+
- name: Update Homebrew Tap
118+
uses: ./.github/actions/update-homebrew-tap
119+
with:
120+
spring-boot-version: ${{ needs.build-and-stage-release.outputs.version }}
121+
token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
108122
create-github-release:
109123
name: Create GitHub Release
110124
needs:
111125
- build-and-stage-release
112126
- promote-release
113127
- publish-gradle-plugin
114128
- publish-to-sdkman
129+
- update-homebrew-tap
115130
runs-on: ubuntu-latest
116131
steps:
117132
- name: Check Out Code

0 commit comments

Comments
 (0)