-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (36 loc) · 1.23 KB
/
publish-artifact.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: publish-artifact
on:
release:
types: [released]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-20.04
environment: Treeverse signing
steps:
- name: Checkout
uses: actions/checkout@v3
- if: github.event.release
name: Create release tag
run: |
TAG=${{ github.event.release.tag_name }}
echo "TAG=${TAG#v}" >> $GITHUB_ENV
- if: github.event.release
name: Update version in pom.xml
run: mvn -B versions:set -DnewVersion=$TAG -DgenerateBackupPoms=false
- name: Set up Java and Maven Central Repository
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Build and publish package
run: mvn -DskipTests --batch-mode deploy --activate-profiles sign-artifacts
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_PASSPHRASE }}