WalletAndroid-SDK-Publish #544
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: WalletAndroid-SDK-Publish | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| environment: | |
| description: 'Environment to deploy to' | |
| required: true | |
| type: choice | |
| options: | |
| - dev | |
| - rc | |
| - prod | |
| jobs: | |
| release-android-sdk: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: π§Ύ Checkout code | |
| uses: actions/checkout@v4 | |
| - name: β Set up Java 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 17 | |
| distribution: temurin | |
| - name: π οΈ Set up Gradle | |
| uses: gradle/actions/setup-gradle@v3 | |
| - name: π Get version from build.gradle | |
| run: | | |
| VERSION=$(grep 'publishVersion *= *".*"' VCL/build.gradle | sed -n 's/.*publishVersion *= *"\([^"]*\)".*/\1/p') | |
| echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV | |
| echo "Found version: $VERSION" | |
| - name: π§ Set publication name and POM file name | |
| run: | | |
| PUB_NAME= | |
| echo "PUBLICATION_NAME=${{ github.event.inputs.environment == 'rc' && 'rc' || 'release' }}" >> $GITHUB_ENV | |
| echo "POM_FILE_NAME=vcl-${{ github.event.inputs.environment == 'rc' && 'rc-' || '' }}${RELEASE_VERSION}.pom" >> $GITHUB_ENV | |
| - name: π§ͺ Build AAR + Sources + Javadoc | |
| run: | | |
| ./gradlew clean \ | |
| :VCL:assembleAll${{ github.event.inputs.environment == 'rc' && 'Rc' || 'Release' }} \ | |
| -PprojectVersion=${RELEASE_VERSION} \ | |
| -Pprerelease=${{ github.event.inputs.environment == 'rc' }} \ | |
| --stacktrace | |
| - name: β Verify expected artifacts exist | |
| run: | | |
| ./gradlew \ | |
| :VCL:verifyExpectedArtifactsExist | |
| - name: π¦ Stage Artifacts | |
| run: | | |
| ./gradlew :VCL:stageArtifacts | |
| - name: π§ͺ Generate POM File | |
| run: | | |
| ./gradlew :VCL:generatePomFileFor${{ env.PUBLICATION_NAME }}Publication | |
| cp VCL/build/publications/${{ env.PUBLICATION_NAME }}/pom-default.xml VCL/target/staging-deploy/io/velocitycareerlabs/vcl/$RELEASE_VERSION/${{ env.POM_FILE_NAME }} | |
| - name: π List staged artifacts | |
| run: | | |
| ls -R VCL/target/staging-deploy | |
| - name: π Run JReleaser full-release | |
| if: github.event.inputs.environment != 'dev' | |
| uses: jreleaser/release-action@v2 | |
| with: | |
| version: 1.18.0 | |
| arguments: > | |
| full-release | |
| --config-file=jreleaser.template.yml | |
| --debug | |
| env: | |
| JRELEASER_PROJECT_JAVA_ARTIFACT_ID: ${{ github.event.inputs.environment == 'rc' && 'vcl-rc' || 'vcl' }} | |
| JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_TOKEN_USERNAME }} | |
| JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_TOKEN_PASSWORD }} | |
| JRELEASER_MAVENCENTRAL_STAGE: ${{ secrets.MAVEN_CENTRAL_STAGING_PROFILE_ID }} | |
| JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| JRELEASER_PROJECT_VERSION: ${{ env.RELEASE_VERSION }} | |
| JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_CENTRAL_GPG_PUBLIC_KEY }} | |
| JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_CENTRAL_GPG_PRIVATE_KEY }} | |
| JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_CENTRAL_SIGNING_PASSWORD }} | |
| JRELEASER_TAG_NAME: ${{ github.event.inputs.environment == 'rc' && 'rc-' || '' }}${{ env.RELEASE_VERSION }} | |
| JRELEASER_RELEASE_NAME: ${{ github.event.inputs.environment == 'rc' && 'Release Candidate ' || '' }}${{ env.RELEASE_VERSION }} | |
| JRELEASER_PRERELEASE_PATTERN: ${{ github.event.inputs.environment == 'rc' && env.RELEASE_VERSION || 'OFF' }} | |