File tree 2 files changed +24
-31
lines changed
2 files changed +24
-31
lines changed Original file line number Diff line number Diff line change 11
11
types : [published]
12
12
13
13
jobs :
14
- publish :
14
+ publish-snapshot :
15
+ name : Publish Snapshot
16
+ if : github.event_name == 'push' || github.event_name == 'pull_request'
15
17
runs-on : ubuntu-latest
16
18
steps :
17
19
- uses : actions/checkout@v3
18
-
19
- - name : Setup
20
- id : setup
20
+ - name : Set up Java for publishing to GitHub Packages
21
+ uses : actions/setup-java@v4
22
+ with :
23
+ java-version : ' 17'
24
+ distribution : ' temurin'
25
+ - name : Publish package
21
26
run : |
22
- # set PROFILE according to the event
23
- if [ -n "${{ github.event.release }}" ]; then
24
- echo "PROFILE=release" >> $GITHUB_ENV
25
- else
26
- echo "PROFILE=snapshot" >> $GITHUB_ENV
27
- fi
28
- echo "PROFILE: ${PROFILE}"
27
+ mvn -P snapshot --batch-mode deploy
28
+ env :
29
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
29
30
30
- - name : Set up Maven Central Repository
31
- id : setup-maven
31
+ publish-release :
32
+ name : Publish Release
33
+ if : github.event_name == 'release'
34
+ runs-on : ubuntu-latest
35
+ steps :
36
+ - uses : actions/checkout@v3
37
+ - name : Set up Java for publishing to Maven Central
32
38
uses : actions/setup-java@v4
33
39
with :
34
40
java-version : ' 17'
38
44
server-password : MAVEN_PASSWORD
39
45
gpg-private-key : ${{ secrets.GPG_PRIVATE_KEY }}
40
46
gpg-passphrase : MAVEN_GPG_PASSPHRASE
41
-
42
47
- name : Publish package
43
48
run : |
44
- mvn -P ${{ env.PROFILE }} --batch-mode deploy
49
+ mvn -P release --batch-mode deploy
45
50
env :
46
51
MAVEN_USERNAME : ${{ secrets.OSSRH_USERNAME }}
47
52
MAVEN_PASSWORD : ${{ secrets.OSSRH_PASSWORD }}
Original file line number Diff line number Diff line change 5
5
6
6
<groupId >io.crawlab</groupId >
7
7
<artifactId >crawlab-sdk</artifactId >
8
- <version >0.7.0-SNAPSHOT </version >
8
+ <version >${project.version} </version >
9
9
<packaging >jar</packaging >
10
10
11
11
<name >Crawlab SDK</name >
30
30
<url >https://github.com/crawlab-team/crawlab-java-sdk</url >
31
31
</scm >
32
32
33
- <distributionManagement >
34
- <repository >
35
- <id >central</id >
36
- <name >Central Repository</name >
37
- <url >https://central.sonatype.com/content/repositories/releases</url >
38
- </repository >
39
- <snapshotRepository >
40
- <id >central</id >
41
- <name >Central Snapshots</name >
42
- <url >https://central.sonatype.com/content/repositories/snapshots</url >
43
- </snapshotRepository >
44
- </distributionManagement >
45
-
46
33
<properties >
47
34
<maven .compiler.source>17</maven .compiler.source>
48
35
<maven .compiler.target>17</maven .compiler.target>
36
+ <project .version>0.7.0</project .version>
49
37
</properties >
50
38
51
39
<dependencies >
133
121
</plugins >
134
122
</build >
135
123
<properties >
136
- <version >0.7.0 </version >
124
+ <version >${project.version} </version >
137
125
</properties >
138
126
</profile >
139
127
187
175
</plugins >
188
176
</build >
189
177
<properties >
190
- <version >0.7.0 -SNAPSHOT</version >
178
+ <version >${project.version} -SNAPSHOT</version >
191
179
</properties >
192
180
</profile >
193
181
</profiles >
You can’t perform that action at this time.
0 commit comments