Skip to content

Dynamic Loading of Proto Descriptors (#521) #36

Dynamic Loading of Proto Descriptors (#521)

Dynamic Loading of Proto Descriptors (#521) #36

Workflow file for this run

name: Publish
on:
release:
types: [ created ]
push:
branches: [ main ]
jobs:
publish-libraries:
runs-on: ubuntu-latest
name: Publishing Explorer Libraries
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Java Setup
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
server-id: github
- name: GPG Setup
env:
GPG_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
run: |
export GPG_TTY=$(tty)
echo -n "$GPG_KEY" | base64 --decode | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
echo -n "$GPG_KEY" | base64 --decode > $GITHUB_WORKSPACE/release.gpg
- name: Build and Publish
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GPG_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
run: |
SNAPSHOT=1.0-SNAPSHOT
# If its a release, we use that
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
VERSION=$(echo $VERSION | sed -e 's/^v//')
if [[ $GITHUB_REF == refs/heads/* ]]; then # If its a head branch, check if its the default, and set to snapshot version
VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
if [ "${{ github.event.repository.default_branch }}" = "$VERSION" ]; then
VERSION=$SNAPSHOT
fi
fi
echo version::${VERSION}
./gradlew publishToSonatype \
$(if [ $VERSION = $SNAPSHOT ]; then echo 'closeSonatypeStagingRepository'; else echo 'closeAndReleaseSonatypeStagingRepository'; fi) \
-Pversion=${VERSION} \
-PartifactVersion=${VERSION} \
-Psigning.keyId=B7D30ABE \
-Psigning.password="$GPG_PASSWORD" \
-Psigning.secretKeyRingFile=$GITHUB_WORKSPACE/release.gpg \
--info