-
Notifications
You must be signed in to change notification settings - Fork 94
114 lines (98 loc) · 3.74 KB
/
release.yml
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Jandex Release
on:
pull_request:
types:
- closed
paths:
- '.github/project.yml'
jobs:
release:
name: Release
runs-on: ubuntu-latest
if: ${{github.event.pull_request.merged == true}}
env:
GITHUB_TOKEN: ${{secrets.RELEASE_TOKEN}}
steps:
- name: Retrieve project metadata
id: metadata
uses: radcortez/project-metadata-action@main
with:
github-token: ${{secrets.GITHUB_TOKEN}}
metadata-file-path: '.github/project.yml'
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{secrets.RELEASE_TOKEN}}
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
server-id: 'oss.sonatype'
server-username: 'MAVEN_DEPLOY_USERNAME'
server-password: 'MAVEN_DEPLOY_TOKEN'
gpg-private-key: ${{secrets.MAVEN_GPG_PRIVATE_KEY}}
gpg-passphrase: 'MAVEN_GPG_PASSPHRASE'
- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.8.7
- name: Maven release ${{steps.metadata.outputs.current-version}}
env:
MAVEN_DEPLOY_USERNAME: ${{secrets.MAVEN_DEPLOY_USERNAME}}
MAVEN_DEPLOY_TOKEN: ${{secrets.MAVEN_DEPLOY_TOKEN}}
MAVEN_GPG_PASSPHRASE: ${{secrets.MAVEN_GPG_PASSPHRASE}}
run: |
export MAVEN_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED"
java -version
mvn --version
git config --global user.name "SmallRye CI"
git config --global user.email "smallrye@googlegroups.com"
git checkout -b release
sed -i -e 's|<version.jandex>.*</version.jandex>|<version.jandex>${{steps.metadata.outputs.current-version}}</version.jandex>|' benchmarks/pom.xml
sed -i -e 's|^version: main|version: ${{steps.metadata.outputs.current-version}}|' doc/antora.yml
git commit -a -m 'Amendments before release'
mvn -B release:prepare -Prelease -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}}
git checkout ${{github.base_ref}}
git rebase release
mvn -B release:perform -Prelease
sed -i -e 's|<version.jandex>.*</version.jandex>|<version.jandex>${project.version}</version.jandex>|' benchmarks/pom.xml
sed -i -e 's|^version: ${{steps.metadata.outputs.current-version}}|version: main|' doc/antora.yml
git commit -a -m 'Amendments after release'
git push
git push --tags
- name: Milestone release
uses: radcortez/milestone-release-action@main
with:
github-token: ${{secrets.GITHUB_TOKEN}}
milestone-title: ${{steps.metadata.outputs.current-version}}
milestone-next: ${{steps.metadata.outputs.next-version}}
github-pages:
name: GitHub Pages
needs:
- release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: gh-pages
- name: Set up Node.js 16
uses: actions/setup-node@v4
with:
node-version: 16
- name: Generate and push
run: |
node --version
curl -s -L -o antora-playbook.yml https://github.com/smallrye/jandex/blob/main/doc/antora-playbook-prod.yml?raw=true
npm install @antora/cli@3.0 @antora/site-generator-default@3.0
npx antora generate antora-playbook.yml
rm -rf node_modules docs package.json package-lock.json antora-playbook.yml
mv -T build/site docs
touch docs/.nojekyll
git config --global user.name "SmallRye CI"
git config --global user.email "smallrye@googlegroups.com"
git status
git add -A .
git commit -m 'Generate documentation site'
git push