generated from quarkiverse/quarkiverse-template
-
Notifications
You must be signed in to change notification settings - Fork 50
66 lines (57 loc) · 1.76 KB
/
release-snapshot-old.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
61
62
63
64
65
66
name: Release snapshot
on:
workflow_call:
inputs:
branch:
type: string
required: false
default: 'main'
version:
type: string
required: false
secrets:
GPG_PRIVATE_KEY:
required: true
OSSRH_USERNAME:
required: true
OSSRH_TOKEN:
required: true
GPG_PASSPHRASE:
required: true
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
release-snapshot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: "${{inputs.branch}}"
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Change version to "${{inputs.version}}" if needed
if: ${{ inputs.version != '' }}
run: |
echo "Set version to ${{inputs.version}}"
./mvnw versions:set -DnewVersion="${{inputs.version}}" versions:commit -Puse-snapshots
- name: Output information
run: echo "Release snapshot for branch ${{inputs.branch}} with version $(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)"
- name: Deploy maven snapshot
run: |
./mvnw -B deploy -DperformRelease -Dno-samples -Dno-docs -Prelease,use-snapshots
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}