Release 20.5.0 (#2006) #187
Workflow file for this run
This file contains hidden or 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: Release | |
| on: | |
| push: | |
| tags: | |
| - "[0-9]+.[0-9]+.[0-9]+*" | |
| jobs: | |
| release: | |
| if: github.repository == 'urbanairship/android-library' | |
| runs-on: | |
| labels: airship-large-runner | |
| permissions: | |
| contents: write | |
| outputs: | |
| version: ${{ steps.get_version.outputs.VERSION }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Get the version | |
| id: get_version | |
| run: | | |
| echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT | |
| - name: Get the release notes | |
| id: get_release_notes | |
| env: | |
| VERSION: ${{ steps.get_version.outputs.VERSION }} | |
| run: | | |
| delimiter="$(openssl rand -hex 8)" | |
| { | |
| echo "NOTES<<${delimiter}" | |
| awk "/## Version $VERSION/{flag=1;next}/## Version/{flag=0}flag" CHANGELOG.md | |
| echo ${delimiter} | |
| } >> $GITHUB_OUTPUT | |
| - name: Setup Java Version | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Copy CI gradle.properties | |
| run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | |
| - name: Verify Version | |
| run: | | |
| VERSION=${{ steps.get_version.outputs.VERSION }} | |
| if [[ $(./gradlew -q getVersion) = $VERSION ]]; then exit 0 ; else exit 1; fi | |
| - name: Build | |
| run: ./gradlew assembleRelease packageDocs --stacktrace | |
| - name: Publish to Maven Central | |
| env: | |
| MAVEN_USER: ${{ secrets.MAVEN_USER }} | |
| MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | |
| SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
| SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | |
| run: ./gradlew publishAggregationToCentralPortal --stacktrace | |
| - name: Github Release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ steps.get_version.outputs.VERSION }} | |
| release_name: ${{ steps.get_version.outputs.VERSION }} | |
| body: ${{ steps.get_release_notes.outputs.NOTES }} | |
| draft: false | |
| prerelease: false | |
| - name: Upload docs package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: packaged-docs-${{ steps.get_version.outputs.VERSION }} | |
| retention-days: 1 | |
| path: | | |
| build/docs/${{ steps.get_version.outputs.VERSION }}-kdoc.tar.gz | |
| # The publish-docs workflow will build the docs if we | |
| # somehow fail to upload them in this step. | |
| if-no-files-found: warn | |
| release-docs: | |
| if: github.repository == 'urbanairship/android-library' | |
| needs: release | |
| uses: ./.github/workflows/publish-docs.yml | |
| with: | |
| version: ${{ needs.release.outputs.version }} | |
| secrets: | |
| GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} | |
| deploy-to-github-pages: | |
| if: github.repository == 'urbanairship/android-library' | |
| needs: release | |
| uses: ./.github/workflows/deploy-docs-to-pages.yml | |
| with: | |
| version: ${{ needs.release.outputs.version }} |