Skip to content

Fix release build (#93) #37

Fix release build (#93)

Fix release build (#93) #37

Workflow file for this run

name: release
on:
push:
tags:
- v*
workflow_dispatch: {} # support manual runs
permissions:
contents: write
jobs:
library:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ github.token }}
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Configure GPG signing & publish
env:
GPG_KEY: ${{ secrets.GPG_KEY }}
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
run: |
export ORG_GRADLE_PROJECT_mavenCentralUsername=$SONATYPE_USER
export ORG_GRADLE_PROJECT_mavenCentralPassword=$SONATYPE_PASSWORD
export ORG_GRADLE_PROJECT_signingInMemoryKeyPassword=$GPG_PASSPHRASE
release_version=$(git describe --tags --abbrev=0 --exact-match)
export ORG_GRADLE_PROJECT_releaseVersion="${release_version:1}"
# https://github.com/keybase/keybase-issues/issues/2798
export GPG_TTY=$(tty)
# Import gpg keys and warm the passphrase to avoid the gpg
# passphrase prompt when initiating a deploy
# `--pinentry-mode=loopback` could be needed to ensure we
# suppress the gpg prompt
echo $GPG_KEY | base64 --decode > signing-key
gpg --passphrase $GPG_PASSPHRASE --batch --import signing-key
export ORG_GRADLE_PROJECT_signingInMemoryKey=$(gpg --armor --passphrase $GPG_PASSPHRASE --pinentry-mode=loopback --export-secret-keys $GPG_KEY_NAME signing-key | grep -v '\-\-' | grep -v '^=.' | tr -d '\n')
shred signing-key
make release
plugin:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: sha256
run: |
tag=$(git describe --tags --abbrev=0 --exact-match)
release_version="${tag:1}"
echo "release_version=${release_version}" >> "$GITHUB_ENV"
export ORG_GRADLE_PROJECT_releaseVersion="${release_version}"
make buildplugin
mv ./protoc-gen-connect-kotlin/build/libs/protoc-gen-connect-kotlin-${release_version}.jar .
sha256sum protoc-gen-connect-kotlin-${release_version}.jar >> sha256.txt
- name: Publish GitHub artifacts
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
append_body: true
files: |
protoc-gen-connect-kotlin-${{ env.release_version }}.jar
sha256.txt