4
4
push :
5
5
branches : [ master ]
6
6
7
+ permissions :
8
+ contents : write
9
+ pull-requests : write
10
+
7
11
jobs :
8
- check_code : # Validates the code (see develop .yml)
12
+ check_code : # Validates the code (see checkBuild .yml)
9
13
runs-on : ubuntu-latest
10
14
steps :
11
- - uses : actions/checkout@v2
15
+ - uses : actions/checkout@v3
12
16
13
- - name : Set up JDK 8
14
- uses : actions/setup-java@v2
17
+ - name : Set up JDK
18
+ uses : actions/setup-java@v3
15
19
with :
16
20
distribution : ' temurin'
17
21
java-version : ' 8'
18
22
cache : ' maven'
19
- server-id : xdevjfrog
20
- server-username : JFROG_ARTIFACTORY_USERNAME # env variable name for username of Artifactory server
21
- server-password : JFROG_ARTIFACTORY_TOKEN # env variable name for Artifactory access token
23
+ server-id : proprietary-xdev-dependencies
24
+ server-username : GH_PACKAGES_READ_USERNAME # env variable name for username of Artifactory server
25
+ server-password : GH_PACKAGES_READ_TOKEN # env variable name for Artifactory access token
22
26
23
27
- name : Build with Maven
24
28
run : mvn -B clean verify
25
29
env :
26
- JFROG_ARTIFACTORY_USERNAME : ${{ secrets.JFROG_ARTIFACTORY_USERNAME }}
27
- JFROG_ARTIFACTORY_TOKEN : ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
30
+ GH_PACKAGES_READ_USERNAME : ${{ secrets.GH_PACKAGES_READ_USERNAME }}
31
+ GH_PACKAGES_READ_TOKEN : ${{ secrets.GH_PACKAGES_READ_TOKEN }}
28
32
29
33
- name : Check for uncommited changes
30
34
run : |
50
54
outputs :
51
55
upload_url : ${{ steps.create_draft.outputs.upload_url }}
52
56
steps :
53
- - uses : actions/checkout@v2
57
+ - uses : actions/checkout@v3
54
58
55
59
- name : Configure Git
56
60
run : |
63
67
- name : Get version
64
68
id : version
65
69
run : |
66
- echo "::set-output name=release::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
70
+ version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
71
+ echo "release=$version" >> $GITHUB_OUTPUT
72
+ echo "releasenumber=${version//[!0-9]/}" >> $GITHUB_OUTPUT
67
73
68
74
- name : Commit and Push
69
75
run : |
@@ -75,40 +81,38 @@ jobs:
75
81
76
82
- name : Create Release
77
83
id : create_release
78
- uses : actions/create-release@v1
79
- env :
80
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
84
+ uses : shogo82148/actions-create-release@v1
81
85
with :
82
86
tag_name : v${{ steps.version.outputs.release }}
83
87
release_name : v${{ steps.version.outputs.release }}
84
88
commitish : master
85
89
body : |
86
- ## Installation [](https://mvnrepository.com/artifact/com.xdev-software/csapi)
90
+ ## [Changelog](https://github.com/xdev-software/${{ github.event.repository.name }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }})
91
+ 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.
92
+ ## Installation
87
93
Add the following lines to your pom:
88
94
```XML
89
95
<dependency>
90
96
<groupId>com.xdev-software</groupId>
91
- <artifactId>csapi </artifactId>
97
+ <artifactId>${{ github.event.repository.name }} </artifactId>
92
98
<version>${{ steps.version.outputs.release }}</version>
93
99
</dependency>
94
100
```
95
- draft : false
96
- prerelease : false
97
101
98
102
publish_central : # Publish the code to central
99
103
runs-on : ubuntu-latest
100
104
needs : [prepare_release]
101
105
steps :
102
- - uses : actions/checkout@v2
106
+ - uses : actions/checkout@v3
103
107
104
108
- name : Init Git and pull
105
109
run : |
106
110
git config --global user.email "actions@github.com"
107
111
git config --global user.name "GitHub Actions"
108
112
git pull
109
113
110
- - name : Set up JDK 8 OSSRH
111
- uses : actions/setup-java@v2
114
+ - name : Set up JDK OSSRH
115
+ uses : actions/setup-java@v3
112
116
with : # running setup-java again overwrites the settings.xml
113
117
distribution : ' temurin'
114
118
java-version : ' 8'
@@ -120,7 +124,7 @@ jobs:
120
124
# Due to https://github.com/actions/setup-java/issues/85 we can only
121
125
# add ONE server using setup-java...
122
126
overwrite-settings : false
123
-
127
+
124
128
# ... so let's simply copy a predefined settings.xml file into the m2 folder
125
129
# until GH makes it work
126
130
- name : Copy predefined settings into home m2 folder
@@ -131,8 +135,8 @@ jobs:
131
135
- name : Publish to OSSRH
132
136
run : mvn -B deploy -Pxdev-build,ossrh
133
137
env :
134
- JFROG_ARTIFACTORY_USERNAME : ${{ secrets.JFROG_ARTIFACTORY_USERNAME }}
135
- JFROG_ARTIFACTORY_TOKEN : ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
138
+ GH_PACKAGES_READ_USERNAME : ${{ secrets.GH_PACKAGES_READ_USERNAME }}
139
+ GH_PACKAGES_READ_TOKEN : ${{ secrets.GH_PACKAGES_READ_TOKEN }}
136
140
MAVEN_CENTRAL_USERNAME : ${{ secrets.MAVEN_CENTRAL_USERNAME }}
137
141
MAVEN_CENTRAL_TOKEN : ${{ secrets.MAVEN_CENTRAL_TOKEN }}
138
142
MAVEN_GPG_PASSPHRASE : ${{ secrets.MAVEN_GPG_PASSPHRASE }}
@@ -142,31 +146,31 @@ jobs:
142
146
runs-on : ubuntu-latest
143
147
needs : [prepare_release]
144
148
steps :
145
- - uses : actions/checkout@v2
149
+ - uses : actions/checkout@v3
146
150
147
151
- name : Init Git and pull
148
152
run : |
149
153
git config --global user.email "actions@github.com"
150
154
git config --global user.name "GitHub Actions"
151
155
git pull
152
156
153
- - name : Set up JDK 8
154
- uses : actions/setup-java@v2
157
+ - name : Set up JDK
158
+ uses : actions/setup-java@v3
155
159
with :
156
160
distribution : ' temurin'
157
161
java-version : ' 8'
158
- server-id : xdevjfrog
159
- server-username : JFROG_ARTIFACTORY_USERNAME # env variable name for username of Artifactory server
160
- server-password : JFROG_ARTIFACTORY_TOKEN # env variable name for Artifactory access token
162
+ server-id : proprietary-xdev-dependencies
163
+ server-username : GH_PACKAGES_READ_USERNAME # env variable name for username of Artifactory server
164
+ server-password : GH_PACKAGES_READ_TOKEN # env variable name for Artifactory access token
161
165
162
166
- name : Build dependencies/licenses files
163
167
run : mvn -B project-info-reports:dependencies
164
168
env :
165
- JFROG_ARTIFACTORY_USERNAME : ${{ secrets.JFROG_ARTIFACTORY_USERNAME }}
166
- JFROG_ARTIFACTORY_TOKEN : ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
169
+ GH_PACKAGES_READ_USERNAME : ${{ secrets.GH_PACKAGES_READ_USERNAME }}
170
+ GH_PACKAGES_READ_TOKEN : ${{ secrets.GH_PACKAGES_READ_TOKEN }}
167
171
168
172
- name : Upload licenses - Upload Artifact
169
- uses : actions/upload-artifact@v2
173
+ uses : actions/upload-artifact@v3
170
174
with :
171
175
name : dependencies-licenses
172
176
path : target/site
@@ -200,7 +204,7 @@ jobs:
200
204
runs-on : ubuntu-latest
201
205
needs : [publish_central]
202
206
steps :
203
- - uses : actions/checkout@v2
207
+ - uses : actions/checkout@v3
204
208
205
209
- name : Init Git and pull
206
210
run : |
@@ -220,7 +224,6 @@ jobs:
220
224
- name : pull-request
221
225
uses : repo-sync/pull-request@v2
222
226
with :
223
- github_token : ${{ secrets.GITHUB_TOKEN }}
224
227
destination_branch : " develop"
225
228
pr_title : " Sync back"
226
229
pr_body : " An automated PR to sync changes back"
0 commit comments