-
Notifications
You must be signed in to change notification settings - Fork 37
120 lines (102 loc) · 4.27 KB
/
prepare-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
115
116
117
118
119
120
name: SmallRye Prepare Release
on:
pull_request:
types:
- closed
paths:
- '.github/project.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
before-release:
name: Before release
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.merged == true}}
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: Create GitHub App Token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.CI_APP_ID }}
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
token: ${{steps.app-token.outputs.token}}
- name: Get GitHub App User ID
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
- name: Configure Git author
run: |
git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>'
- name: Before release
run: |
java -version
mvn --version
sed -i -e 's|^version: main|version: ${{steps.metadata.outputs.current-version}}|' doc/antora.yml
sed -i -e 's|smallrye-fault-tolerance-version: .*|smallrye-fault-tolerance-version: '"'"'${{steps.metadata.outputs.current-version}}'"'"'|' doc/antora.yml
MP_FT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=version.microprofile-fault-tolerance -q -DforceStdout)
sed -i -e 's|microprofile-fault-tolerance-version: .*|microprofile-fault-tolerance-version: '"'$MP_FT_VERSION'"'|' doc/antora.yml
VERTX_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=version.vertx -q -DforceStdout)
sed -i -e 's|vertx4-version: .*|vertx4-version: '"'$VERTX_VERSION'"'|' doc/antora.yml
git add -A .
git commit -a -m 'Amendments before release'
git push
prepare-release:
name: Prepare release
needs: before-release
if: ${{ github.event.pull_request.merged == true}}
uses: smallrye/.github/.github/workflows/prepare-release.yml@main
secrets: inherit
with:
ref: ${{ github.ref }}
after-release:
name: After release
runs-on: ubuntu-latest
needs: prepare-release
if: ${{ github.event.pull_request.merged == true}}
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: Create GitHub App Token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.CI_APP_ID }}
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
token: ${{steps.app-token.outputs.token}}
- name: Get GitHub App User ID
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
- name: Configure Git author
run: |
git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>'
- name: After release
run: |
sed -i -e 's|https://smallrye.io/docs/smallrye-fault-tolerance/.*/index.html|https://smallrye.io/docs/smallrye-fault-tolerance/${{steps.metadata.outputs.current-version}}/index.html|' README.adoc
sed -i -e 's|^version: ${{steps.metadata.outputs.current-version}}|version: main|' doc/antora.yml
git add -A .
git commit -a -m 'Amendments after release'
git push