|
| 1 | +name: 'Release Driver' |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - '*' |
| 7 | + |
| 8 | +permissions: |
| 9 | + actions: write |
| 10 | + contents: write |
| 11 | + deployments: write |
| 12 | + packages: write |
| 13 | + pull-requests: write |
| 14 | + repository-projects: write |
| 15 | + |
| 16 | +jobs: |
| 17 | + ubuntu-latest-build-and-release: |
| 18 | + name: 'Build and Release Driver' |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - name: 'Clone Repository' |
| 22 | + uses: actions/checkout@v2 |
| 23 | + with: |
| 24 | + fetch-depth: 50 |
| 25 | + - name: 'Build Driver' |
| 26 | + uses: burrunan/gradle-cache-action@v1 |
| 27 | + env: |
| 28 | + S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }} |
| 29 | + S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }} |
| 30 | + with: |
| 31 | + job-id: jdk8 |
| 32 | + arguments: --no-parallel --no-daemon jandex -x test build |
| 33 | + - name: 'Set Version Env Variable' |
| 34 | + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV |
| 35 | + - name: 'Get Release Details' |
| 36 | + run: | |
| 37 | + export RELEASE_DETAILS="$(awk -vN=2 'n<N;/^## /{++n}' CHANGELOG.md)" |
| 38 | + export RELEASE_DETAILS="$(sed '${/^# /d;}' <<< "$RELEASE_DETAILS")" |
| 39 | + export RELEASE_DETAILS="$(sed '$d' <<< "$RELEASE_DETAILS")" |
| 40 | + touch RELEASE_DETAILS.md |
| 41 | + echo "$RELEASE_DETAILS" > RELEASE_DETAILS.md |
| 42 | + - name: 'Install GPG Secret Key' |
| 43 | + id: import_gpg |
| 44 | + uses: crazy-max/ghaction-import-gpg@v4 |
| 45 | + with: |
| 46 | + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} |
| 47 | + passphrase: ${{ secrets.GPG_PASSPHRASE }} |
| 48 | + - name: 'Sign Jars' |
| 49 | + run: | |
| 50 | + export GPG_TTY=$(tty) |
| 51 | + for jar in pgjdbc/build/libs/*.jar; do gpg --detach-sign --armor $jar; done |
| 52 | + for signed in pgjdbc/build/libs/*.asc; do gpg --verify $signed; done |
| 53 | + - name: 'Upload to Release' |
| 54 | + uses: ncipollo/release-action@v1 |
| 55 | + with: |
| 56 | + draft: true |
| 57 | + name: "AWS JDBC Driver for PostgreSQL Public Preview - v${{ env.RELEASE_VERSION }}" |
| 58 | + bodyFile: RELEASE_DETAILS.md |
| 59 | + artifacts: pgjdbc/build/libs/* |
| 60 | + token: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments