-
Notifications
You must be signed in to change notification settings - Fork 10
60 lines (58 loc) · 2.19 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
51
52
53
54
55
56
57
58
59
60
name: Release on demand
on:
workflow_call:
inputs:
releaseVersion:
description: "Version to release"
required: true
default: "X.Y.Z"
type: string
snapshotVersion:
description: "Snapshot version after release"
required: true
default: "X.Y.Z-SNAPSHOT"
type: string
centralDeployServer:
description: "Specify maven deployment server."
required: false
default: "oss"
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Set Github identity
run: |
git config --global user.name clojure-build
git config --global user.email "[email protected]"
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: 8
distribution: 'temurin'
cache: 'maven'
server-id: sonatype-nexus-staging
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Publish to Maven OSS Server
if: ${{ inputs.centralDeployServer == 'oss' }}
run: mvn -ntp -B -DreleaseVersion=${{ github.event.inputs.releaseVersion }} -DdevelopmentVersion=${{ github.event.inputs.snapshotVersion }} -DskipStaging=true -Psign -Dmaven.test.skip=true release:prepare release:perform
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Publish to Maven S01 Server
if: ${{ inputs.centralDeployServer == 's01' }}
run: mvn -ntp -B -DreleaseVersion=${{ github.event.inputs.releaseVersion }} -DdevelopmentVersion=${{ github.event.inputs.snapshotVersion }} -DskipStaging=true -Psign -Dmaven.test.skip=true release:prepare release:perform
env:
MAVEN_USERNAME: ${{ secrets.S01RH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.S01RH_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Tag
run: |
git push --tags
git push