88 required : true
99permissions :
1010 id-token : write # This is required for requesting the JWT
11- contents : read # This is required for actions/checkout
11+ contents : write # This is required for branch creation
12+ pull-requests : write # required for opening pull requests
1213 attestations : write # required for provenance
1314jobs :
1415 release :
1516 runs-on : ubuntu-latest
1617 steps :
1718 - name : Checkout repository
18- uses : actions/checkout@v5
19+ uses : actions/checkout@v6
20+
1921 - name : Set up JDK 21
2022 uses : actions/setup-java@v5
2123 with :
@@ -39,45 +41,16 @@ jobs:
3941 core.setSecret(token);
4042 console.log('OIDC token acquired. Length:', token.length);
4143
42- - name : Set up git
43- run : |
44- git config --global user.email "support@qbic.zendesk.com"
45- git config --global user.name "JohnnyQ5"
46-
4744 - name : Set version in Maven project
4845 run : mvn versions:set -DnewVersion=${{ github.event.inputs.versionTag }} -DprocessAllModules
4946
5047 - name : Build with Maven
51- run : VAADIN_OFFLINE_KEY=${{ secrets.VAADIN_SERVER_23_2 }} mvn -B package -Pproduction -Dvaadin.force.production.build=true --file pom.xml
52-
53- - name : Create Release Notes
54- if : ${{ !startsWith(github.ref, 'refs/tags/')
55- && !( contains(github.event.inputs.versionTag, 'alpha')
56- || contains(github.event.inputs.versionTag, 'beta')
57- || contains(github.event.inputs.versionTag, 'rc')) }}
58- uses : actions/github-script@v7
59- with :
60- github-token : ${{secrets.JOHNNY_Q5_REPORTS_TOKEN}}
61- script : |
62- await github.request(`POST /repos/${{ github.repository }}/releases`, {
63- tag_name: "${{ github.event.inputs.versionTag }}",
64- generate_release_notes: true
65- });
48+ run : mvn -B package -Pproduction -Dvaadin.force.production.build=true --file pom.xml
6649
67- - name : Create Pre-Release Notes
68- if : ${{ !startsWith(github.ref, 'refs/tags/')
69- && ( contains(github.event.inputs.versionTag, 'alpha')
70- || contains(github.event.inputs.versionTag, 'beta')
71- || contains(github.event.inputs.versionTag, 'rc')) }}
72- uses : actions/github-script@v7
73- with :
74- github-token : ${{secrets.JOHNNY_Q5_REPORTS_TOKEN}}
75- script : |
76- await github.request(`POST /repos/${{ github.repository }}/releases`, {
77- tag_name: "${{ github.event.inputs.versionTag }}",
78- generate_release_notes: true,
79- prerelease: true
80- });
50+ - name : Create GitHub Release
51+ run : gh release create ${{ github.event.inputs.versionTag }} --generate-notes --fail-on-no-commits
52+ env :
53+ GH_TOKEN : ${{ github.token }}
8154
8255 # Generate provenance (SLSA attestation) for all JARs
8356 - name : Generate SLSA build provenance
@@ -91,25 +64,21 @@ jobs:
9164 MAVEN_REPO_USERNAME : ${{ secrets.NEXUS_USERNAME }}
9265 MAVEN_REPO_PASSWORD : ${{ secrets.NEXUS_PASSWORD }}
9366
67+ - name : Configure Git Credentials
68+ run : |
69+ git config user.name github-actions
70+ git config user.email github-actions@github.com
71+
9472 - name : Switch to new branch
9573 run : git checkout -b release/set-version-to-${{ github.event.inputs.versionTag }}
9674
97- - name : Set remote branch
98- run : git push --set-upstream origin release/set-version-to-${{ github.event.inputs.versionTag }}
99-
10075 - name : Checkin commit
10176 run : git commit . -m 'Set version to ${{ github.event.inputs.versionTag }}'
10277
10378 - name : Push to Github
104- run : git push
79+ run : git push --set-upstream origin release/set-version-to-${{ github.event.inputs.versionTag }}
10580
10681 - name : Open PR with version bump
107- uses : actions/github-script@v7
108- with :
109- github-token : ${{secrets.JOHNNY_Q5_REPORTS_TOKEN}}
110- script : |
111- await github.request(`POST /repos/${{ github.repository }}/pulls`, {
112- title: 'Update version to ${{ github.event.inputs.versionTag }}',
113- head: 'release/set-version-to-${{ github.event.inputs.versionTag }}',
114- base: 'main'
115- });
82+ run : gh pr create --base main --title "Update version to ${{ github.event.inputs.versionTag }}" --body "Updates the project version after a release to ${{ github.event.inputs.versionTag }}"
83+ env :
84+ GH_TOKEN : ${{ github.token }}
0 commit comments