Publishing to Sonatype #21
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publishing to Sonatype | |
on: | |
release: | |
types: [published] | |
env: | |
GH_TOKEN: ${{ github.token }} | |
jobs: | |
build_and_publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8.0.362' | |
distribution: 'zulu' | |
- name: Prepare gradle.properties | |
run: | | |
echo "$(pwd)" | |
echo -e "${{ secrets.SECRING }}" | base64 -d > ./secring.gpg | |
echo "$(ls -la)" | |
touch ./gradle.properties | |
echo "signing.keyId=${{ secrets.KEYID }}" >> ./gradle.properties | |
echo "signing.password=${{ secrets.PASS }}" >> ./gradle.properties | |
echo "signing.secretKeyRingFile=$(pwd)/secring.gpg" >> ./gradle.properties | |
echo "sonatypeUsername=${{ secrets.SUSER }}" >> ./gradle.properties | |
echo "sonatypePassword=${{ secrets.SPASSWORD }}" >> ./gradle.properties | |
echo "$(ls -la)" | |
- name: Prepare build.gradle | |
run: | | |
sed -i -e 's|.*sonatypeUsername.*| username = "${{ secrets.SUSER }}"|' ./build.gradle | |
sed -i -e 's|.*sonatypePassword.*| password = "${{ secrets.SPASSWORD }}"|' ./build.gradle | |
- name: Publish to Sonatype | |
run: | | |
./gradlew publishJarPublicationToStagingRepository |