This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
feat: optin #44
Workflow file for this run
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: Publish | |
on: | |
pull_request: | |
branches: | |
- main | |
types: | |
- closed | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
publish: | |
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout TIKI Publish Client | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Extract version from Gradle build script | |
id: extract_version | |
run: | | |
export VERSION=$(perl -ne 'print "$1\n" if /val versionName = "([^"]+)"/' client/build.gradle.kts) | |
echo "version: $VERSION" | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
- name: Set up Java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v3 | |
- name: Validate Gradle Wrapper | |
uses: gradle/wrapper-validation-action@v3 | |
- name: Release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ steps.extract_version.outputs.version }} | |
- name: "Publish" | |
uses: gradle/gradle-build-action@v3 | |
with: | |
arguments: publishReleasePublicationToOSSRHRepository | |
env: | |
OSSRH_USER: ${{ secrets.OSSRH_USER }} | |
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} | |
PGP_PRIVATE_KEY: ${{ secrets.PGP_PRIVATE_KEY }} | |
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} |