Skip to content

Commit 51110f9

Browse files
authored
Publish uberjar as github release (#187)
1 parent 8eb5cbf commit 51110f9

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

.github/workflows/publish.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: publish jar
2+
on:
3+
push:
4+
tags:
5+
- "v*.*.*"
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
packages: write
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-java@v3
18+
with:
19+
java-version: '8'
20+
distribution: 'adopt'
21+
cache: 'maven'
22+
- name: Set version
23+
run: mvn versions:set -DnewVersion=${{ github.ref_name }}
24+
- name: Build jar
25+
run: mvn -B clean package -DskipTests
26+
# - name: publish maven jar
27+
# run: mvn -B deploy -DskipTests -DrepositoryId=github
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
31+
32+
- name: Rename artifact
33+
run: mv target/ysoserial-${{ github.ref_name }}-all.jar target/ysoserial-all.jar
34+
35+
- name: Publish GitHub release
36+
uses: softprops/action-gh-release@v1
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
with:
40+
files: target/ysoserial-all.jar

pom.xml

+7
Original file line numberDiff line numberDiff line change
@@ -438,4 +438,11 @@
438438
</profile>
439439

440440
</profiles>
441+
<distributionManagement>
442+
<repository>
443+
<id>github</id>
444+
<name>GitHub Packages</name>
445+
<url>https://maven.pkg.github.com/frohoff/ysoserial</url>
446+
</repository>
447+
</distributionManagement>
441448
</project>

0 commit comments

Comments
 (0)