-
Notifications
You must be signed in to change notification settings - Fork 94
47 lines (39 loc) · 1.29 KB
/
version-and-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
name: Release
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: get version from tag
id: get_version
run: |
realversion="${GITHUB_REF/refs\/tags\//}"
realversion="${realversion//v/}"
echo "VERSION=$realversion" >> "$GITHUB_OUTPUT"
- name: Set up publishing to maven central
uses: actions/setup-java@v2
with:
java-version: 17
distribution: 'zulu'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: mvn versions
run: mvn versions:set -DnewVersion=${{ steps.get_version.outputs.VERSION }}
- name: Install gpg key
run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Publish
working-directory: redis-om-spring
run: |
mvn --no-transfer-progress \
--batch-mode \
-Dgpg.passphrase='${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}' \
-DskipTests deploy -P release
env:
MAVEN_USERNAME: ${{secrets.OSSRH_USERNAME}}
MAVEN_PASSWORD: ${{secrets.OSSRH_TOKEN}}