-
Notifications
You must be signed in to change notification settings - Fork 6
97 lines (78 loc) · 3.18 KB
/
spring-finalize-release.yml
File metadata and controls
97 lines (78 loc) · 3.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Create GH release and close milestone
on:
workflow_call:
inputs:
milestone:
description: 'Milestone title, e.g 3.0.0-M1, 3.1.0-RC1, 3.2.0 etc.'
required: true
type: string
secrets:
GH_ACTIONS_REPO_TOKEN:
required: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SPRING_MAIN_BANNERMODE: off
WORKFLOWS_REF: main
jobs:
finalize-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
show-progress: false
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 24
- name: Compute Next Snapshot
id: next-snapshot
uses: spring-io/spring-release-actions/compute-next-snapshot@0.0.4
with:
version: ${{ inputs.milestone }}
- name: Tag Release and Next Development Version
id: tag-release
run: |
if test -f pom.xml
then
mvn versions:set -DnewVersion=${{ inputs.milestone }} -DgenerateBackupPoms=false -DprocessAllModules=true -B -ntp
else
sed -i "s/version=.*/version=${{ inputs.milestone }}/" gradle.properties
fi
git config --global user.name 'Spring Builds'
git config --global user.email 'builds@springframework.org'
git fetch origin --no-tags
git pull origin ${{ github.ref }}
git commit -a -m "[CI/CD] Release version ${{ inputs.milestone }}"
git tag "v${{ inputs.milestone }}"
NEXT_VERSION="${{ steps.next-snapshot.outputs.version }}"
if test -f pom.xml
then
mvn versions:set -DnewVersion=$NEXT_VERSION -DgenerateBackupPoms=false -DprocessAllModules=true -B -ntp
else
sed -i "s/version=.*/version=$NEXT_VERSION/" gradle.properties
fi
git commit -a -m "[CI/CD] Next development version"
git push origin
git push --tags origin
echo nextVersion=$NEXT_VERSION >> $GITHUB_OUTPUT
- name: Changelog Config File
run: |
repositoryTeam=$(gh api repos/$GITHUB_REPOSITORY/collaborators --jq 'map(select(.role_name == "admin") | .login) | join(",")')
repositoryVisibility=$(gh repo view --json visibility --jq 'if .visibility == "PUBLIC" then "true" else "false" end')
echo "changelog.contributors.exclude.names=$repositoryTeam" > changelog.properties
echo "changelog.issues.generate-links=$repositoryVisibility" >> changelog.properties
- name: Generate Changelog
uses: spring-io/github-changelog-generator@v0.0.14
with:
milestone: ${{ inputs.milestone }}
token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
config-file: changelog.properties
- name: GitHub Release
uses: spring-io/spring-release-actions/publish-release-notes@0.0.4
with:
tag: v${{ inputs.milestone }}
- name: Close Milestone
uses: spring-io/spring-release-actions/close-milestone@0.0.4
with:
version: ${{ inputs.milestone }}