-
Notifications
You must be signed in to change notification settings - Fork 37
74 lines (63 loc) · 2.38 KB
/
release-mvn-central.yml
File metadata and controls
74 lines (63 loc) · 2.38 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Deploy to MVN Central
env:
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
CI_GPG_PASSPHRASE: ${{ secrets.CI_GPG_PASSPHRASE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
on:
workflow_dispatch:
inputs:
releaseVersion:
description: "Default version to use when preparing a release."
required: true
default: "X.Y"
developmentVersion:
description: "Default version to use for new local working copy."
required: true
default: "X.Y-SNAPSHOT"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Switch to master
run: git switch -c release-${{ github.event.inputs.releaseVersion }}
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: "20.x"
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ${{ env.HOME }}/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 17
java-package: jdk
distribution: temurin
cache: 'maven'
server-id: ossrh
server-username: CI_DEPLOY_USERNAME
server-password: CI_DEPLOY_PASSWORD
gpg-private-key: ${{ secrets.CI_GPG_PRIVATE_KEY }}
gpg-passphrase: CI_GPG_PASSPHRASE
- name: Configure git
run: |
gpg --list-keys
git config --global committer.email "infra@finos.org"
git config --global committer.name "FINOS Admin"
git config --global author.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global author.name "${GITHUB_ACTOR}"
- name: Setup SSH Access for Commit
uses: kielabokkie/ssh-key-and-known-hosts-action@v1.3.0
with:
ssh-private-key: ${{ secrets.COMMIT_SSH_PRIVATE_KEY }}
ssh-host: github.com
- name: Build with Maven
run: mvn --no-transfer-progress release:prepare release:perform -P sign-it -Dsign=true -DreleaseVersion=${{ github.event.inputs.releaseVersion }} -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }}