Skip to content

Commit

Permalink
Improve the before/after release procedures
Browse files Browse the repository at this point in the history
  • Loading branch information
Ladicek committed Oct 25, 2024
1 parent cf0c5fb commit cc34c43
Showing 1 changed file with 38 additions and 4 deletions.
42 changes: 38 additions & 4 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,34 @@ jobs:
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
git config --global user.name "SmallRye CI"
git config --global user.email "[email protected]"
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)
Expand Down Expand Up @@ -70,15 +87,32 @@ jobs:
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: |
git config --global user.name "SmallRye CI"
git config --global user.email "[email protected]"
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 .
Expand Down

0 comments on commit cc34c43

Please sign in to comment.