Merge pull request #462 from mindbox-cloud/release/2.10.0-rc #312
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: | |
- 'master' | |
- 'support/*' | |
paths-ignore: | |
- '**.md' | |
tags-ignore: | |
- '**' | |
jobs: | |
lint: | |
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: Setup Android SDK | |
uses: android-actions/setup-android@v2 | |
- name: lint check | |
run: ./gradlew --no-daemon check | |
unit: | |
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: Setup Android SDK | |
uses: android-actions/setup-android@v2 | |
- name: unit tests | |
run: ./gradlew --no-daemon testDebugUnitTest | |
build: | |
needs: [ unit, lint ] | |
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 Jitpack | |
# To create release in Jitpack we need to create Github release | |
run: ./git-release.sh "${{secrets.GITHUBACCESSTOKEN}}" "${{secrets.GITHUBUSER}}" | |
- name: Publish to Sonatype | |
run: ./gradlew --no-daemon publish -PsonatypeUsername=${{secrets.OSSRHUSERNAME}} -PsonatypePassword=${{secrets.OSSRHPASSWORD}} | |
#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 | |
- name: Job status notification | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }} | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_MESSAGE: 'SDK is available for public release https://oss.sonatype.org/#stagingRepositories' | |
SLACK_USERNAME: MindBox-bot | |
SLACK_ICON: 'https://mindbox.ru/blog/wp-content/uploads/2020/06/favicon.png' | |
SLACK_COLOR: ${{job.status}} |