44 push :
55 branches : [ master ]
66
7+ permissions :
8+ contents : write
9+ pull-requests : write
10+
711jobs :
8- check_code : # Validates the code (see develop .yml)
12+ check_code : # Validates the code (see checkBuild .yml)
913 runs-on : ubuntu-latest
1014 steps :
11- - uses : actions/checkout@v2
15+ - uses : actions/checkout@v4
1216
13- - name : Set up JDK 8
14- uses : actions/setup-java@v2
17+ - name : Set up JDK
18+ uses : actions/setup-java@v4
1519 with :
1620 distribution : ' temurin'
1721 java-version : ' 8'
4448 outputs :
4549 upload_url : ${{ steps.create_draft.outputs.upload_url }}
4650 steps :
47- - uses : actions/checkout@v2
51+ - uses : actions/checkout@v4
4852
4953 - name : Configure Git
5054 run : |
5761 - name : Get version
5862 id : version
5963 run : |
60- echo "::set-output name=release::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
64+ version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
65+ echo "release=$version" >> $GITHUB_OUTPUT
66+ echo "releasenumber=${version//[!0-9]/}" >> $GITHUB_OUTPUT
6167
6268 - name : Commit and Push
6369 run : |
@@ -69,40 +75,38 @@ jobs:
6975
7076 - name : Create Release
7177 id : create_release
72- uses : actions/create-release@v1
73- env :
74- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
78+ uses : shogo82148/actions-create-release@v1
7579 with :
7680 tag_name : v${{ steps.version.outputs.release }}
7781 release_name : v${{ steps.version.outputs.release }}
7882 commitish : master
7983 body : |
84+ ## [Changelog](https://github.com/xdev-software/${{ github.event.repository.name }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }})
85+ See [Changelog#v${{ steps.version.outputs.release }}](https://github.com/xdev-software/${{ github.event.repository.name }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) for more information.
8086 ## Installation
8187 Add the following lines to your pom:
8288 ```XML
8389 <dependency>
8490 <groupId>com.xdev-software</groupId>
85- <artifactId>xapi </artifactId>
91+ <artifactId>${{ github.event.repository.name }} </artifactId>
8692 <version>${{ steps.version.outputs.release }}</version>
8793 </dependency>
8894 ```
89- draft : false
90- prerelease : false
9195
9296 publish_central : # Publish the code to central
9397 runs-on : ubuntu-latest
9498 needs : [prepare_release]
9599 steps :
96- - uses : actions/checkout@v2
100+ - uses : actions/checkout@v4
97101
98102 - name : Init Git and pull
99103 run : |
100104 git config --global user.email "actions@github.com"
101105 git config --global user.name "GitHub Actions"
102106 git pull
103107
104- - name : Set up JDK 8 OSSRH
105- uses : actions/setup-java@v2
108+ - name : Set up JDK OSSRH
109+ uses : actions/setup-java@v4
106110 with : # running setup-java again overwrites the settings.xml
107111 distribution : ' temurin'
108112 java-version : ' 8'
@@ -124,16 +128,16 @@ jobs:
124128 runs-on : ubuntu-latest
125129 needs : [prepare_release]
126130 steps :
127- - uses : actions/checkout@v2
131+ - uses : actions/checkout@v4
128132
129133 - name : Init Git and pull
130134 run : |
131135 git config --global user.email "actions@github.com"
132136 git config --global user.name "GitHub Actions"
133137 git pull
134138
135- - name : Set up JDK 8
136- uses : actions/setup-java@v2
139+ - name : Set up JDK
140+ uses : actions/setup-java@v4
137141 with :
138142 distribution : ' temurin'
139143 java-version : ' 8'
@@ -142,7 +146,7 @@ jobs:
142146 run : mvn -B project-info-reports:dependencies
143147
144148 - name : Upload licenses - Upload Artifact
145- uses : actions/upload-artifact@v2
149+ uses : actions/upload-artifact@v3
146150 with :
147151 name : dependencies-licenses
148152 path : target/site
@@ -176,7 +180,7 @@ jobs:
176180 runs-on : ubuntu-latest
177181 needs : [publish_central]
178182 steps :
179- - uses : actions/checkout@v2
183+ - uses : actions/checkout@v4
180184
181185 - name : Init Git and pull
182186 run : |
@@ -194,9 +198,12 @@ jobs:
194198 git push origin
195199
196200 - name : pull-request
197- uses : repo-sync/pull-request@v2
198- with :
199- github_token : ${{ secrets.GITHUB_TOKEN }}
200- destination_branch : " develop"
201- pr_title : " Sync back"
202- pr_body : " An automated PR to sync changes back"
201+ env :
202+ GH_TOKEN : ${{ github.token }}
203+ run : |
204+ gh_pr_up() {
205+ gh pr create "$@" || gh pr edit "$@"
206+ }
207+ gh_pr_up -B "develop" \
208+ --title "Sync back" \
209+ --body "An automated PR to sync changes back"
0 commit comments