Skip to content

Merge pull request #19 from cashapp/enable-release-signing #17

Merge pull request #19 from cashapp/enable-release-signing

Merge pull request #19 from cashapp/enable-release-signing #17

Workflow file for this run

name: "Publish library"
on:
push:
tags:
- 'v*'
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Check release version number
run: |
set -euxo pipefail
release_version=`echo ${{ github.ref_name }} | grep -Eo '[0-9]+.[0-9]+.[0-9]+'`
echo "release_version=$release_version" >> $GITHUB_ENV
- name: Setup JDK 17
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
- name: Setup gradle
uses: gradle/gradle-build-action@v2
- name: "Verify release tag"
uses: cashapp/check-signature-action@v0.2.0
id: check-tag-sig
env:
GH_TOKEN: ${{ github.token }}
with:
allowed-release-signers: yoavamit
- name: Build library
uses: gradle/gradle-build-action@v2
with:
arguments: |
-Pversion=${{ env.release_version }}
build
- name: Publish to GitHub Releases
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "./build/libs/jooq-encryption-${{ env.release_version }}.jar"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to MavenCentral
uses: gradle/gradle-build-action@v2
with:
arguments: |
-PVERSION_NAME=${{ env.release_version }}
publish
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ARTIFACT_SIGNING_PRIVATE_KEY }}