forked from aws/aws-advanced-jdbc-wrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (61 loc) · 2.17 KB
/
release_draft.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
name: 'Release Draft'
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
permissions:
actions: write
contents: write
deployments: write
packages: write
pull-requests: write
repository-projects: write
jobs:
ubuntu-latest-jdbc-wrapper-release-gh-draft:
name: 'Build And Release Draft'
runs-on: ubuntu-latest
steps:
- name: 'Clone Repository'
uses: actions/checkout@v4
with:
fetch-depth: 50
- name: 'Set up JDK 8'
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: 8
- name: 'Build Driver'
run: |
./gradlew --no-parallel --no-daemon -x test build
./gradlew --no-parallel --no-daemon -x test shadowJar
- name: 'Set Version Env Variable'
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: 'Get Release Details'
run: |
export RELEASE_DETAILS="$(awk -vN=2 'n<N;/^## /{++n}' CHANGELOG.md)"
export RELEASE_DETAILS="$(sed '${/^# /d;}' <<< "$RELEASE_DETAILS")"
export RELEASE_DETAILS="$(sed '$d' <<< "$RELEASE_DETAILS")"
touch RELEASE_DETAILS.md
echo "$RELEASE_DETAILS" > RELEASE_DETAILS.md
- name: 'Install GPG Secret Key'
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: 'Sign Jars'
working-directory: ./wrapper
run: |
export GPG_TTY=$(tty)
KEYGRIP="$(gpg --with-keygrip -K | grep -Pom1 '^ *Keygrip += +\K.*')"
/usr/lib/gnupg2/gpg-preset-passphrase -c $KEYGRIP <<< ${{ secrets.GPG_PASSPHRASE }}
for jar in build/libs/*.jar; do gpg --detach-sign --armor $jar; done
for signed in build/libs/*.asc; do gpg --verify $signed; done
- name: 'Upload to Draft Release'
uses: ncipollo/release-action@v1
with:
draft: true
name: "AWS Advanced JDBC Driver - v${{ env.RELEASE_VERSION }}"
bodyFile: RELEASE_DETAILS.md
artifacts: ./wrapper/build/libs/*
token: ${{ secrets.GITHUB_TOKEN }}