Release #221
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: | |
| workflow_dispatch: | |
| inputs: | |
| major: | |
| description: "Major" | |
| type: boolean | |
| default: false | |
| minor: | |
| description: "Minor" | |
| type: boolean | |
| default: false | |
| jobs: | |
| publish: | |
| name: Release build and publish | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: write # allows release-it to pick up GITHUB_TOKEN | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| token: ${{ secrets.PAT_GITHUB }} | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v2 | |
| with: | |
| aws-region: us-west-2 | |
| role-to-assume: ${{ secrets.ACTIONS_ROLE }} | |
| - name: Update Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: "zulu" | |
| java-version: "17" | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Install NDK & tools | |
| # Starts from: pwd => /home/runner/work/rive/rive | |
| # ANDROID_HOME => /usr/local/lib/android/sdk | |
| run: | | |
| set -x | |
| echo "y" | sdkmanager --install 'build-tools;34.0.0' platform-tools --sdk_root=${ANDROID_SDK_ROOT} | |
| cd ${ANDROID_HOME} | |
| wget -q https://dl.google.com/android/repository/android-ndk-r27c-linux.zip | |
| unzip -q android-ndk-r27c-linux.zip | |
| echo "y" | sdkmanager --install 'cmake;3.22.1' --channel=0 --sdk_root=${ANDROID_SDK_ROOT} | |
| - name: Configure venv | |
| run: | | |
| python3 -m venv .venv | |
| source .venv/bin/activate | |
| echo PATH=$PATH >> $GITHUB_ENV | |
| - name: Installing pre-requisites | |
| run: | | |
| set -x | |
| # Install some dependencies & premake5 | |
| sudo apt update && sudo apt-get -y install clang libgl1-mesa-dev libvorbis-dev libvpx-dev ninja-build uuid-dev | |
| wget -q https://github.com/premake/premake-core/releases/download/v5.0.0-beta2/premake-5.0.0-beta2-linux.tar.gz | |
| tar -xf premake-5.0.0-beta2-linux.tar.gz | |
| sudo mv premake5 /usr/local/bin | |
| # Base64 decodes and pipes the GPG key content into the secret file | |
| - name: Prepare environment | |
| env: | |
| GPG_KEY_CONTENTS: ${{ secrets.GPG_KEY_CONTENTS }} | |
| SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }} | |
| run: | | |
| git fetch --unshallow | |
| sudo bash -c "echo '$GPG_KEY_CONTENTS' | base64 -d > '$SIGNING_SECRET_KEY_RING_FILE'" | |
| # Run "release-it", the Node tool that bumps our version number, updates the changelog, and tags the release | |
| - name: Install dependencies | |
| run: npm ci | |
| working-directory: ./.github/scripts/release | |
| - name: Git config | |
| run: | | |
| git config --local user.email '[email protected]' | |
| git config --local user.name ${{ github.actor }} | |
| - if: ${{ inputs.major == true }} | |
| name: Major Release - Bump version number, update changelog, push and tag | |
| run: npm run release -- major --ci | |
| working-directory: ./.github/scripts/release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - if: ${{ inputs.major == false && inputs.minor == true }} | |
| name: Minor release - Bump version number, update changelog, push and tag | |
| run: npm run release -- minor --ci | |
| working-directory: ./.github/scripts/release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - if: ${{ inputs.major == false && inputs.minor == false }} | |
| name: Build release - Bump version number, update changelog, push and tag | |
| run: npm run release -- --ci | |
| working-directory: ./.github/scripts/release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Builds the release artifacts of the library, this depends on the TAGs set in release-it | |
| - name: Build Android | |
| env: | |
| # ANDROID_SDK_ROOT has been in the env by 'setup-android' above | |
| # and is => /usr/local/lib/android/sdk | |
| NDK_PATH: ${{ env.ANDROID_SDK_ROOT }}/android-ndk-r27c | |
| run: ./gradlew kotlin:assembleRelease | |
| # Runs upload, and then closes & releases the repository | |
| - name: Publish to MavenCentral | |
| run: ./gradlew publishToMavenCentral | |
| env: | |
| # Secrets have been updated with the correct <username, password> pair for MavenCentral | |
| # and they use the ORG_GRADLE_PROJECT_ prefix for our plugin to work now | |
| ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }} | |
| ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }} | |
| # ==== | |
| ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY_CONTENTS }} |