Skip to content

Commit

Permalink
workflow updated
Browse files Browse the repository at this point in the history
  • Loading branch information
ktvipin27 committed Nov 21, 2021
1 parent 4690ab0 commit 01eaf6c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 34 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/publish.yml

This file was deleted.

33 changes: 30 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: publish artifact

on:
push:
Expand All @@ -13,7 +13,8 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
- name: Set release name
run: echo ::set-env name=RELEASE_NAME::$(echo ${GITHUB_REF:11})
run: |
echo "RELEASE_NAME=${GITHUB_REF:11}" >> $GITHUB_ENV
- name: Create release
id: create_release
uses: actions/create-release@v1
Expand All @@ -23,4 +24,30 @@ jobs:
tag_name: ${{ github.ref }}
release_name: ${{ env.RELEASE_NAME }}
draft: false
prerelease: false
prerelease: false

publish:
needs: release
name: Publish released build to maven
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 11
- name: Release build
run: ./gradlew assembleRelease
- name: Source jar
run: ./gradlew androidSourcesJar
- name: Publish to MavenCentral
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}

0 comments on commit 01eaf6c

Please sign in to comment.