Skip to content

Commit 0c6b263

Browse files
committed
Merge branch 'publication-package' of https://github.com/DevLab-umontp/API-JAVA-EDT into publication-package
2 parents d5825d6 + 2105e00 commit 0c6b263

File tree

2 files changed

+54
-25
lines changed

2 files changed

+54
-25
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Maven Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish:
9+
10+
runs-on: ubuntu-latest
11+
12+
env:
13+
artifact_name: edt-iut-umontp
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Get the release version
19+
id: get_version
20+
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
21+
22+
- name: Set up JDK 11 for deploy to OSSRH
23+
uses: actions/setup-java@v1
24+
with:
25+
java-version: 11
26+
server-id: ossrh
27+
server-username: MAVEN_USERNAME
28+
server-password: MAVEN_CENTRAL_TOKEN
29+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
30+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
31+
32+
- name: Build with Maven
33+
run: mvn -B package --file pom.xml
34+
35+
- name: Update package version
36+
run: mvn versions:set -DnewVersion=${{ steps.get_version.outputs.VERSION }}
37+
38+
- name: Publish to Apache Maven Central
39+
run: mvn deploy -PossrhDeploy
40+
env:
41+
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
42+
MAVEN_CENTRAL_TOKEN: ${{ secrets.NEXUS_PASSWORD }}
43+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
44+
45+
- name: Set up JDK 11 for deploy to github packages
46+
uses: actions/setup-java@v1
47+
with:
48+
java-version: 11
49+
server-id: github
50+
51+
- name: Publish to GitHub Packages Apache Maven
52+
run: mvn deploy -PgithubDeploy
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)