Skip to content

Commit 8917c94

Browse files
committed
Add workflow for releases to the milestone repository
Closes gh-40426
1 parent fc2890d commit 8917c94

File tree

2 files changed

+80
-1
lines changed

2 files changed

+80
-1
lines changed

.github/actions/create-github-release/action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ inputs:
77
token:
88
description: Token to use for authentication with GitHub
99
required: true
10+
pre-release:
11+
description: Whether the release is a pre-release (a milestone or release candidate)
12+
required: false
13+
default: 'false'
1014
runs:
1115
using: composite
1216
steps:
@@ -20,4 +24,4 @@ runs:
2024
env:
2125
GITHUB_TOKEN: ${{ inputs.token }}
2226
shell: bash
23-
run: gh release create ${{ format('v{0}', inputs.milestone) }} --notes-file changelog.md
27+
run: gh release create ${{ format('v{0}', inputs.milestone) }} --notes-file changelog.md ${{ inputs.pre-release == 'true' && '--prerelease' || '' }}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Release Milestone
2+
on:
3+
push:
4+
tags:
5+
- v3.4.0-M[0-9]
6+
- v3.4.0-RC[0-9]
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
jobs:
10+
build-and-stage-release:
11+
name: Build and Stage Release
12+
runs-on: ubuntu-latest
13+
if: ${{ github.repository == 'spring-projects/spring-boot' }}
14+
steps:
15+
- name: Check Out Code
16+
uses: actions/checkout@v4
17+
- name: Build and Publish
18+
id: build-and-publish
19+
uses: ./.github/actions/build
20+
with:
21+
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
22+
publish: true
23+
- name: Stage Release
24+
uses: spring-io/artifactory-deploy-action@26bbe925a75f4f863e1e529e85be2d0093cac116 # v0.0.1
25+
with:
26+
uri: 'https://repo.spring.io'
27+
username: ${{ secrets.ARTIFACTORY_USERNAME }}
28+
password: ${{ secrets.ARTIFACTORY_PASSWORD }}
29+
build-name: ${{ format('spring-boot-{0}', steps.build-and-publish.outputs.version)}}
30+
repository: 'libs-staging-local'
31+
folder: 'deployment-repository'
32+
signing-key: ${{ secrets.GPG_PRIVATE_KEY }}
33+
signing-passphrase: ${{ secrets.GPG_PASSPHRASE }}
34+
outputs:
35+
version: ${{ steps.build-and-publish.outputs.version }}
36+
verify:
37+
name: Verify
38+
needs: build-and-stage-release
39+
uses: ./.github/workflows/verify.yml
40+
with:
41+
staging: true
42+
version: ${{ needs.build-and-stage-release.outputs.version }}
43+
secrets:
44+
google-chat-webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
45+
repository-password: ${{ secrets.ARTIFACTORY_PASSWORD }}
46+
repository-username: ${{ secrets.ARTIFACTORY_USERNAME }}
47+
token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
48+
promote-release:
49+
name: Promote Release
50+
needs:
51+
- build-and-stage-release
52+
- verify
53+
runs-on: ubuntu-latest
54+
steps:
55+
- name: Set up JFrog CLI
56+
uses: jfrog/setup-jfrog-cli@8bab65dc312163b065ac5b03de6f6a5bdd1bec41 # v4.1.3
57+
env:
58+
JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
59+
- name: Promote build
60+
run: jfrog rt build-promote ${{ format('spring-boot-{0}', needs.build-and-stage-release.outputs.version)}} ${{ github.run_number }} libs-milestone-local
61+
create-github-release:
62+
name: Create GitHub Release
63+
needs:
64+
- build-and-stage-release
65+
- promote-release
66+
runs-on: ubuntu-latest
67+
steps:
68+
- name: Check Out Code
69+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
70+
- name: Create GitHub Release
71+
uses: ./.github/actions/create-github-release
72+
with:
73+
milestone: ${{ needs.build-and-stage-release.outputs.version }}
74+
token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
75+
pre-release: true

0 commit comments

Comments
 (0)