Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RC cutting workflow and tweak others #507

Merged
merged 2 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Actually add the code eh?
  • Loading branch information
bidetofevil committed Mar 5, 2024
commit d4be783e6ee8d3708503153f134146816a0d304b
101 changes: 101 additions & 0 deletions .github/workflows/build-rc-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Pre-Release - Create New Release Candidates

env:
SONATYPE_USERNAME: embrace-io
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_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_dispatch:
inputs:
version_of_rc:
description: 'Version to create new RC for. Specify <major.minor> only, e.g. 6.3'
required: true

jobs:
release:
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
matrix:
jdk-version: [ "17" ]
ndk-version: [ "21.4.7075529" ]
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 '[email protected]'
git config --global url."https://${{ secrets.CD_GITHUB_USER }}:${{ secrets.CD_GITHUB_TOKEN }}@github.com".insteadOf "https://github.com"

- name: Checkout SDK
uses: actions/checkout@v4
with:
ref: release/${{ github.event.inputs.version_of_rc }}
token: ${{ secrets.CD_GITHUB_TOKEN }}

- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.m2/repository
~/.sonar/cache
key: ${{ runner.os }}-gradle-jdk${{ matrix.jdk-version }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle

- name: Install JDK ${{ matrix.jdk-version }}
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: ${{ matrix.jdk-version }}

- name: Setup NDK ${{ matrix.ndk-version }}
run: |
export ANDROID_ROOT=/usr/local/lib/android
export ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk
export ANDROID_NDK_ROOT=${ANDROID_SDK_ROOT}/ndk-bundle
ln -sfn $ANDROID_SDK_ROOT/ndk/${{ matrix.ndk-version }} $ANDROID_NDK_ROOT

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v2

- name: Generate SDK RC - Publish and close Sonatype repository
run: |
./gradlew clean check publishReleasePublicationToSonatype closeSonatypeStagingRepository -Dorg.gradle.parallel=false --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: Checkout Swazzler
uses: actions/checkout@v4
with:
repository: embrace-io/embrace-swazzler3
ref: release/${{ github.event.inputs.version_of_rc }}
token: ${{ secrets.CD_GITHUB_TOKEN }}

- name: Generate Swazzler RC - Publish and Close repository
run: |
./gradlew clean check publishToSonatype closeSonatypeStagingRepository -Dorg.gradle.parallel=false --stacktrace

- name: Cleanup Gradle Cache
# Based on https://docs.github.com/en/actions/guides/building-and-testing-java-with-gradle#caching-dependencies
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
118 changes: 0 additions & 118 deletions .github/workflows/create-release-branch.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/pre-release-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release - Cut Release Branch and Create Release Candidate
name: Pre-Release - Cut Release Branch and Create Release Candidates

env:
SONATYPE_USERNAME: embrace-io
Expand All @@ -16,7 +16,7 @@ on:
description: 'Version to release. Specify <major.minor> only, without the patch number, e.g. 6.3. A new branch called "release/<version>" will be created where the release-specific changes will be committed.'
required: true
next_version:
description: 'Next Version. Specify <major.minor.patch>, e.g. 6.4.0 (Do NOT include -SNAPSHOT, will be added automatically)'
description: 'Next version. Specify <major.minor>, e.g. 6.4 (Do NOT include -SNAPSHOT, will be added automatically)'
required: true

jobs:
Expand Down
Loading