forked from smallrye/jandex
-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (85 loc) · 3.46 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
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@master
with:
github-token: ${{secrets.GITHUB_TOKEN}}
metadata-file-path: '.github/project.yml'
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{secrets.RELEASE_TOKEN}}
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
- name: Maven release ${{steps.metadata.outputs.current-version}}
run: |
java -version
gpg --quiet --batch --yes --decrypt --passphrase="${{secrets.SECRET_PASSPHRASE}}" --output smallrye-sign.asc .github/release/smallrye-sign.asc.gpg
gpg --quiet --batch --yes --decrypt --passphrase="${{secrets.SECRET_PASSPHRASE}}" --output maven-settings.xml .github/release/maven-settings.xml.gpg
gpg --fast-import --no-tty --batch --yes smallrye-sign.asc
git config --global user.name "SmallRye CI"
git config --global user.email "[email protected]"
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}} -s maven-settings.xml
git checkout ${{github.base_ref}}
git rebase release
mvn -B release:perform -Prelease -s maven-settings.xml
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
- uses: radcortez/milestone-release-action@master
name: Milestone release
with:
github-token: ${{secrets.GITHUB_TOKEN}}
milestone-title: ${{steps.metadata.outputs.current-version}}
github-pages:
name: GitHub Pages
needs:
- release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: gh-pages
- name: Set up Node.js 16
uses: actions/setup-node@v3
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/[email protected] @antora/[email protected]
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 "[email protected]"
git status
git add -A .
git commit -m 'Generate documentation site'
git push