change secret for sonotype #316
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: SDK publish | |
on: | |
push: | |
branches: | |
- 'release/2.10.1' | |
paths-ignore: | |
- '**.md' | |
tags-ignore: | |
- '**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'gradle' | |
- name: build project | |
run: ./gradlew --no-daemon assembleDebug | |
publish: | |
needs: [ build ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'gradle' | |
- name: Prepare to publish | |
run: | | |
echo '${{secrets.GPGKEYCONTENTS}}' | base64 -d > /tmp/publish_key.gpg | |
gpg --quiet --batch --yes --decrypt --passphrase="${{secrets.SECRETPASSPHRASE}}" \ | |
--output /tmp/secret.gpg /tmp/publish_key.gpg | |
echo -e "\nsigning.password=$signingpassword" >> gradle.properties | |
echo -e "\nsigning.keyId=$signingkeyId" >> gradle.properties | |
echo -e "\nsigning.secretKeyRingFile=/tmp/secret.gpg" >> gradle.properties | |
env: | |
signingpassword: ${{secrets.signingpassword}} | |
signingkeyId: ${{secrets.signingkeyId}} | |
SECRETPASSPHRASE: ${{secrets.SECRETPASSPHRASE}} | |
GPGKEYCONTENTS: ${{secrets.GPGKEYCONTENTS}} | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' | |
- name: Publish to Sonatype | |
run: ./gradlew --no-daemon publish -PsonatypeUsername=${{secrets.OSSRHTOKEN}} -PsonatypePassword=${{secrets.OSSRHTOKENPASSWORD}} | |
#To update version in Github README.md | |
# - name: Version Upgrade | |
# run: | | |
# chmod +x ./maven-version-update.sh | |
# ./maven-version-update.sh | |
# - name: Commit and push if it changed | |
# run: | | |
# git diff | |
# git config --global user.email "[email protected]" | |
# git config --global user.name "GitHub Actions" | |
#git commit -am "Update README.md" || exit 0 | |
#git push origin HEAD:develop |