Skip to content

Commit 754a852

Browse files
authored
task/v3 (#60)
1 parent 744d4f4 commit 754a852

File tree

2 files changed

+50
-50
lines changed

2 files changed

+50
-50
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
name: Build package using Maven
2-
on:
3-
pull_request:
4-
jobs:
5-
test:
6-
runs-on: ubuntu-latest
7-
steps:
8-
- uses: actions/checkout@v2
9-
- name: Set up JDK 11
10-
uses: actions/setup-java@v2
11-
with:
12-
distribution: 'adopt'
13-
java-version: '11'
14-
15-
- name: Build with Maven
16-
run: mvn -B package --file pom.xml
1+
name: Build package using Maven
2+
on:
3+
pull_request:
4+
jobs:
5+
test:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v3
9+
- name: Set up JDK 11
10+
uses: actions/setup-java@v3
11+
with:
12+
distribution: 'adopt'
13+
java-version: '11'
14+
15+
- name: Build with Maven
16+
run: mvn -B package --file pom.xml

.github/workflows/publish.yml

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
name: Publish package to the Maven Central Repository
2-
on:
3-
release:
4-
types:
5-
- published
6-
jobs:
7-
publish:
8-
if: ${{ !github.event.release.prerelease && github.event.release.target_commitish == 'main' }}
9-
runs-on: ubuntu-latest
10-
steps:
11-
- uses: actions/checkout@v2
12-
- name: Set up Apache Maven Central
13-
uses: actions/setup-java@v2
14-
with:
15-
distribution: 'adopt'
16-
java-version: '11'
17-
server-id: ossrh
18-
server-username: MAVEN_USERNAME
19-
server-password: MAVEN_CENTRAL_TOKEN
20-
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
21-
gpg-passphrase: MAVEN_GPG_PASSPHRASE
22-
23-
- name: Get Maven project version
24-
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
25-
26-
- name: Set Maven project version
27-
run: mvn versions:set -DnewVersion=$RELEASE_VERSION
28-
29-
- name: Publish to Apache Maven Central
30-
run: mvn deploy
31-
env:
32-
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
33-
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
34-
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
1+
name: Publish package to the Maven Central Repository
2+
on:
3+
release:
4+
types:
5+
- published
6+
jobs:
7+
publish:
8+
if: ${{ !github.event.release.prerelease && github.event.release.target_commitish == 'main' }}
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Set up Apache Maven Central
13+
uses: actions/setup-java@v3
14+
with:
15+
distribution: 'adopt'
16+
java-version: '11'
17+
server-id: ossrh
18+
server-username: MAVEN_USERNAME
19+
server-password: MAVEN_CENTRAL_TOKEN
20+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
21+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
22+
23+
- name: Get Maven project version
24+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
25+
26+
- name: Set Maven project version
27+
run: mvn versions:set -DnewVersion=$RELEASE_VERSION
28+
29+
- name: Publish to Apache Maven Central
30+
run: mvn deploy
31+
env:
32+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
33+
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
34+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

0 commit comments

Comments
 (0)