-
Notifications
You must be signed in to change notification settings - Fork 14
50 lines (42 loc) · 1.42 KB
/
release.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
39
40
41
42
43
44
45
46
47
48
49
50
name: Release to maven central
on:
workflow_dispatch:
jobs:
release:
if: github.event.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- run: |
git config --global user.name 'eclipse-uprotocol-bot'
git config --global user.email 'uprotocol-bot@eclipse.org'
- uses: actions/checkout@v4
with:
token: ${{ secrets.BOT_GITHUB_TOKEN }}
- name: Set up Apache Maven Central
uses: actions/setup-java@v3
with: # configure settings.xml
distribution: 'temurin'
java-version: '17'
server-id: ossrh
server-username: OSSRH_USER
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.ORG_GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Stage to Nexus and Release to Maven central
run: |
mvn -B release:clean release:prepare -P release release:perform
env:
OSSRH_USER: ${{ secrets.ORG_OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.ORG_OSSRH_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }}
GH_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
- if: cancelled() || failure()
run: |
mvn -B release:rollback
env:
GH_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}