Skip to content

Commit

Permalink
trigger publish to sonatype
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Sozinov committed Jul 5, 2024
1 parent 5c49b26 commit a258024
Showing 1 changed file with 14 additions and 63 deletions.
77 changes: 14 additions & 63 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,15 @@ name: SDK publish
on:
push:
branches:
- 'master'
- 'support/*'
- 'release/2.10.1'
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
Expand Down Expand Up @@ -90,32 +53,20 @@ jobs:
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 "actions@github.com"
# 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}}
#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 "actions@github.com"
# git config --global user.name "GitHub Actions"
#git commit -am "Update README.md" || exit 0
#git push origin HEAD:develop

0 comments on commit a258024

Please sign in to comment.