Skip to content

Commit ff05286

Browse files
snicollbclozel
authored andcommitted
Add release milestone workflow
This commit adds a dedicated workflow to release a milestone, and publish the changelog with a "pre-release" flag accordingly. Closes gh-1025
1 parent 6f422a9 commit ff05286

File tree

2 files changed

+71
-3
lines changed

2 files changed

+71
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@ name: Create GitHub Release
22
description: Create the release on GitHub with a changelog
33
inputs:
44
milestone:
5-
description: 'Name of the GitHub milestone for which a release will be created'
5+
description: Name of the GitHub milestone for which a release will be created
66
required: true
77
token:
8-
description: 'Token to use for authentication with GitHub'
8+
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: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Release Milestone
2+
on:
3+
push:
4+
tags:
5+
- v1.4.0-M[1-9]
6+
- v1.4.0-RC[1-9]
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
jobs:
10+
build-and-stage-release:
11+
if: ${{ github.repository == 'spring-projects/spring-graphql' }}
12+
name: Build and Stage Release
13+
runs-on: ubuntu-latest
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-graphql-{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+
artifact-properties: |
35+
/**/spring-graphql-docs-*.zip::zip.name=spring-graphql,zip.type=docs,zip.deployed=false
36+
outputs:
37+
version: ${{ steps.build-and-publish.outputs.version }}
38+
promote-release:
39+
name: Promote Release
40+
needs:
41+
- build-and-stage-release
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Set up JFrog CLI
45+
uses: jfrog/setup-jfrog-cli@105617d23456a69a92485207c4f28ae12297581d # v4.2.1
46+
env:
47+
JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
48+
- name: Promote build
49+
run: jfrog rt build-promote ${{ format('spring-graphql-{0}', needs.build-and-stage-release.outputs.version)}} ${{ github.run_number }} libs-milestone-local
50+
create-github-release:
51+
name: Create GitHub Release
52+
needs:
53+
- build-and-stage-release
54+
- promote-release
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Check Out Code
58+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
59+
- name: Create GitHub Release
60+
uses: ./.github/actions/create-github-release
61+
with:
62+
milestone: ${{ needs.build-and-stage-release.outputs.version }}
63+
token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
64+
pre-release: true

0 commit comments

Comments
 (0)