Skip to content

Commit 91f248b

Browse files
committed
Added release deploys
1 parent d83b7a7 commit 91f248b

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Maven Release Deploy
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Set up JDK 1.8
11+
uses: actions/setup-java@v1
12+
with:
13+
java-version: 1.8
14+
- name: Build
15+
run: mvn -B -DnewVersion=${{ github.event.release.tag_name }} package --file pom.xml
16+
- name: Deploy to JavaWebStack Repository
17+
run: mvn deploy -DnewVersion=${{ github.event.release.tag_name }} -s build/settings.xml
18+
env:
19+
DEPLOYMENT_USERNAME: ${{ secrets.DEPLOYMENT_USERNAME }}
20+
DEPLOYMENT_PASSWORD: ${{ secrets.DEPLOYMENT_PASSWORD }}

.github/workflows/maven-deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ jobs:
2626
with:
2727
java-version: 1.8
2828
- name: Build
29-
run: mvn -B package -Dmaven.test.skip=true
29+
run: mvn -DnewVersion=1.0-SNAPSHOT -B package -Dmaven.test.skip=true
3030
- name: Test
3131
run: mvn -B test
3232
env:
3333
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
3434
MYSQL_USERNAME: test
3535
MYSQL_PASSWORD: test
3636
- name: Deploy to JavaWebStack Repository
37-
run: mvn deploy -B -s build/settings.xml -Dmaven.test.skip=true
37+
run: mvn deploy -B -DnewVersion=1.0-SNAPSHOT -s build/settings.xml -Dmaven.test.skip=true
3838
env:
3939
DEPLOYMENT_USERNAME: ${{ secrets.DEPLOYMENT_USERNAME }}
4040
DEPLOYMENT_PASSWORD: ${{ secrets.DEPLOYMENT_PASSWORD }}

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>org.javawebstack</groupId>
88
<artifactId>ORM</artifactId>
9-
<version>1.0-SNAPSHOT</version>
9+
<version>${newVersion}</version>
1010

1111
<repositories>
1212
<repository>
@@ -99,4 +99,4 @@
9999
</repository>
100100
</distributionManagement>
101101

102-
</project>
102+
</project>

0 commit comments

Comments
 (0)