Publish Release #8
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 Release | |
on: | |
release: | |
types: [ created ] | |
concurrency: | |
group: "release" | |
cancel-in-progress: false | |
env: | |
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }} | |
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }} | |
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY }} | |
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.GPG_KEY_ID }} | |
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_KEY_PASSWORD }} | |
jobs: | |
upload: | |
name: Upload artifacts from Linux and macOS | |
strategy: | |
matrix: | |
os: [ macOS-latest, ubuntu-latest ] | |
runs-on: ${{matrix.os}} | |
if: github.repository == 'MayakaApps/Kache' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Setup JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Setup gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Extract Kotlin version | |
run: | | |
echo "KOTLIN_VERSION=$(sed -rn 's/^kotlin[[:space:]]?=[[:space:]]?\"(.*)\"/\1/p' 'gradle/libs.versions.toml')" >> $GITHUB_ENV | |
- name: Restore Konan cache | |
uses: actions/cache/restore@v3 | |
id: restore-cache | |
with: | |
path: ~/.konan | |
key: ${{ runner.os }}-konan-${{ env.KOTLIN_VERSION }} | |
- name: Upload non-Apple artifacts | |
if: matrix.os == 'ubuntu-latest' | |
run: ./gradlew publishAllPublicationsToMavenCentralRepository -PpublicationType=nonAppleOnly --no-parallel | |
- name: Upload Apple artifacts | |
if: matrix.os == 'macOS-latest' | |
run: ./gradlew publishAllPublicationsToMavenCentralRepository -PpublicationType=appleOnly --no-parallel | |
- name: Save Konan cache | |
uses: actions/cache/save@v3 | |
with: | |
path: ~/.konan | |
key: ${{ steps.restore-cache.outputs.cache-primary-key }} |