Skip to content

Bump io.github.gradle-nexus.publish-plugin from 1.3.0 to 2.0.0 (#138) #8

Bump io.github.gradle-nexus.publish-plugin from 1.3.0 to 2.0.0 (#138)

Bump io.github.gradle-nexus.publish-plugin from 1.3.0 to 2.0.0 (#138) #8

Workflow file for this run

name: Tag & Release Workflow
on:
push:
tags:
- 'v*'
jobs:
release:
if: ${{ github.repository == 'Breus/json-masker' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- name: Get version from tag
id: get-version
shell: bash
run: |
version="${GITHUB_REF_NAME#v}"
regex="^([0-9]+)\.([0-9]+)\.([0-9]+)(-[a-zA-Z0-9]+)?$"
if [[ $version =~ $regex ]]; then
echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
else
echo "Version $version is not a valid SemVer"
exit 1
fi
- name: Build
run: ./gradlew -Pversion=${{ steps.get-version.outputs.version }} publishToMavenLocal
- name: Upload release artifacts to Sonatype
env:
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_PRIV_KEY: ${{ secrets.GPG_PRIV_KEY }}
GPG_PASS_PHRASE: ${{ secrets.GPG_PASS_PHRASE }}
run: ./gradlew -Pversion=${{ steps.get-version.outputs.version }} publishAllPublicationsToSonatypeRepository closeAndReleaseSonatypeStagingRepository