Skip to content

Build Release Candidates #40

Build Release Candidates

Build Release Candidates #40

name: Build Release Candidates
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_TOKEN_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_TOKEN_USER_PASSWORD }}
MAVEN_QA_USER: github
MAVEN_QA_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
mavenSigningKeyId: ${{ secrets.MAVEN_ANDROID_SIGNING_KEY }}
mavenSigningKeyRingFileEncoded: ${{ secrets.MAVEN_ANDROID_GPG_KEY }}
mavenSigningKeyPassword: ${{ secrets.MAVEN_ANDROID_SIGNING_PASSWORD }}
on:
workflow_call:
inputs:
version_of_rc:
required: true
type: string
workflow_dispatch:
inputs:
version_of_rc:
description: 'Version to create new RC for. Specify <major.minor> only, e.g. 6.3'
required: true
patch_number:
description: 'Patch number. e.g. for 6.3.1, use "1". Defaults to 0'
default: '0'
required: true
permissions:
contents: write
jobs:
release:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Decode Keystore
run: |
mkdir "$RUNNER_TEMP"/keystore
echo $mavenSigningKeyRingFileEncoded | base64 -di > "$RUNNER_TEMP"/keystore/2DE631C1.gpg
echo "mavenSigningKeyRingFile=$RUNNER_TEMP/keystore/2DE631C1.gpg" >> $GITHUB_ENV
- name: Configure git
run: |
git config --global user.name 'embrace-ci[bot]'
git config --global user.email 'embrace-ci@users.noreply.github.com'
- name: Checkout SDK
uses: actions/checkout@v4
with:
ref: release/${{ github.event.inputs.version_of_rc }}
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Generate SDK RC - Publish and close Sonatype repository
run: |
./gradlew clean publishReleasePublicationToSonatype closeSonatypeStagingRepository -Dorg.gradle.parallel=false --no-build-cache --no-configuration-cache --stacktrace
- name: Archive Test Results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: android-sdk-test-results
path: embrace-android-sdk/build/reports/tests/
- name: Set version tag in SDK
run: |
git push origin :refs/tags/${{ github.event.inputs.version_of_rc }}.${{ github.event.inputs.patch_number }}
git tag -f ${{ github.event.inputs.version_of_rc }}.${{ github.event.inputs.patch_number }}
git push origin --tags
- name: Checkout Swazzler
uses: actions/checkout@v4
with:
repository: embrace-io/embrace-swazzler3
ref: release/${{ github.event.inputs.version_of_rc }}
token: ${{ secrets.GH_EMBRACE_SWAZZLER3_TOKEN }}
- name: Generate Swazzler RC - Publish and Close repository
run: |
./gradlew clean check publishToSonatype closeSonatypeStagingRepository -Dorg.gradle.parallel=false --no-build-cache --no-configuration-cache --stacktrace
- name: Set version tag in Swazzler
run: |
git push origin :refs/tags/${{ github.event.inputs.version_of_rc }}.${{ github.event.inputs.patch_number }}
git tag -f ${{ github.event.inputs.version_of_rc }}.${{ github.event.inputs.patch_number }}
git push origin --tags