-
Notifications
You must be signed in to change notification settings - Fork 2
93 lines (89 loc) · 2.73 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: release
on:
push:
branches:
- main
tags:
- "*.*.*"
- "v*.*.*"
- "*.*.*-*"
- "v*.*.*-*"
jobs:
e2e:
uses: ./.github/workflows/_e2e_multi.yml
with:
notify_slack_if_failed: false
release:
if: startsWith( github.ref, 'refs/tags/')
needs:
- e2e
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create release
if: startsWith( github.ref, 'refs/tags/')
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
publish:
if: startsWith( github.ref, 'refs/tags/')
needs:
- e2e
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Prepare for publish
run: |
./gradlew clean
echo "${PGP_PRIVATE_KEY}" > private_key.txt
gpg --import --batch private_key.txt
rm -f private_key.txt
gpg --pinentry-mode loopback --passphrase "${GPG_PASSPHRASE}" --export-secret-keys -o ~/.gnupg/secring.gpg
cat << EOF > ~/.gradle/gradle.properties
org.gradle.daemon=true
signing.keyId=${GPG_KEYID}
signing.password=${GPG_PASSPHRASE}
signing.secretKeyRingFile=${HOME}/.gnupg/secring.gpg
sonatypeUsername=${SONATYPE_USERNAME}
sonatypePassword=${SONATYPE_PASSWORD}
nexusUsername=${SONATYPE_USERNAME}
nexusPassword=${SONATYPE_PASSWORD}
EOF
env:
GPG_KEYID: ${{ secrets.GPG_KEYID }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
PGP_PRIVATE_KEY: ${{ secrets.PGP_PRIVATE_KEY }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
- name: Publish
run: |
./gradlew clean
make vald
./gradlew build -x test --stacktrace
./gradlew publish -Prelease --stacktrace
sleep 120
./gradlew closeAndReleaseRepository --stacktrace
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
notify_release_status:
name: Notify release status to slack
runs-on: ubuntu-latest
needs:
- publish
- release
if: ${{ success() || failure() }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/notify-slack
with:
author_name: Release vald-java-client
slack_notify_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}