Release #181
This file contains 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: read | |
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-r25b-linux.zip | |
unzip -q android-ndk-r25b-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 python3-pip | |
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.RIVE_REPO_PAT }} | |
- 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.RIVE_REPO_PAT }} | |
- 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.RIVE_REPO_PAT }} | |
# 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-r25b | |
run: ./gradlew kotlin:assembleRelease | |
# Runs upload, and then closes & releases the repository | |
- name: Publish to MavenCentral | |
run: ./gradlew publishAllPublicationsToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository | |
env: | |
UAT_OSSRH_USERNAME: ${{ secrets.UAT_OSSRH_USERNAME }} | |
UAT_OSSRH_PASSWORD: ${{ secrets.UAT_OSSRH_PASSWORD }} | |
# TODO: remove these after UAT is confirmed working | |
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
# ==== | |
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} | |
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | |
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }} | |
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} |