Skip to content

Deploy to central

Deploy to central #21

Workflow file for this run

name: Deploy to central
on:
release:
types:
- published
concurrency:
group: release
cancel-in-progress: true
permissions:
contents: read
jobs:
deploy-sdk:
name: Deploy SDK
strategy:
matrix:
include:
# - target: publishIosArm64PublicationToSonatypeRepository
# os: macos-latest
- target: :shared:publishAllPublicationsToMavenCentralRepository
os: ubuntu-latest
- target: :android:publishAllPublicationsToMavenCentralRepository
os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v3
- uses: actions/cache@v4
with:
path: |
~/.konan
key: ${{ runner.os }}-${{ hashFiles('**/.lock') }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
passphrase: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
- name: Write release version
run: |
VERSION=${GITHUB_REF_NAME#v}
echo Version: $VERSION
- name: Deploy
uses: gradle/gradle-build-action@v3
with:
arguments: ${{ matrix.target }} --no-configuration-cache --no-daemon
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MEMORY_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
SDK_VERSION: ${GITHUB_REF_NAME#v}
deploy-app:
name: Deploy Android App
needs: deploy-sdk
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v3
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
- name: Write release version
run: |
VERSION=${GITHUB_REF_NAME#v}
echo Version: $VERSION
- name: Setup local.properties
run: touch local.properties && echo "TEST_SERVER_URL=$TEST_SERVER_URL" >> local.properties
- name: Build SoundBud!
run: ./gradlew :example-android:assembleDevRelease
- name: Publish SoundBud!
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: example-android/build/outputs/apk/dev/release/example-android-dev-release.apk
asset_name: SoundBud-v$VERSION.apk
tag: $VERSION
make_latest: false
env:
VERSION: ${GITHUB_REF_NAME#v}