Skip to content

ci: fix publish workflow #7

ci: fix publish workflow

ci: fix publish workflow #7

Workflow file for this run

name: Publish
on:
push:
tags: ["*"]
concurrency:
cancel-in-progress: true
group: ${{github.workflow}}-${{github.ref_name}}
permissions:
packages: write
contents: read
jobs:
gpr:
runs-on: ${{matrix.os}}
name: Publish ${{matrix.platform}} packages on GPR
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-latest, target: KotlinMultiplatform, platform: common }
- { os: ubuntu-latest, target: Jvm, platform: jvm }
- { os: ubuntu-latest, target: AndroidRelease, platform: android }
- { os: ubuntu-latest, target: Js, platform: node }
- { os: ubuntu-latest, target: LinuxX64, platform: linux-x64 }
- { os: ubuntu-latest, target: LinuxArm64, platform: linux-arm64 }
- { os: windows-latest, target: MingwX64, platform: mingw-x64 }
- { os: macos-13, target: MacosX64, platform: macos-x64 }
- { os: macos-14, target: MacosArm64, platform: macos-arm64 }
- { os: macos-14, target: IosArm64, platform: ios-arm64 }
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: gradle
cache-dependency-path: |
gradle/libs.versions.toml
gradle/wrapper/gradle-wrapper.properties
- name: Set up cross compilation
run: sudo apt-get install -qy {binutils,gcc}-aarch64-linux-gnu
if: matrix.platform == 'linux-arm64' || matrix.platform == 'common'
- name: Get the Kotlin version
id: kotlin
shell: sh
run: >-
sed -n 's/kotlin-stdlib = "\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)"/version=\1\2\3/p'
gradle/libs.versions.toml >> "$GITHUB_OUTPUT"
- name: Restore Kotlin/Native prebuilt
uses: actions/cache/restore@v4
with:
path: ${{runner.tool_cache}}/konan/kotlin-native-prebuilt-*
key: konan-${{matrix.os}}-prebuilt-${{steps.kotlin.outputs.version}}
- name: Restore Kotlin/Native dependencies
uses: actions/cache/restore@v4
if: endsWith(matrix.platform, '64')
with:
path: ${{runner.tool_cache}}/konan/dependencies
key: >-
konan-${{matrix.os}}-dependencies-${{
matrix.platform == 'ios-arm64' && 'macos-arm64' || matrix.platform}}
- name: Publish packages
shell: bash
run: |-
target='publish${{matrix.target}}PublicationToGitHubRepository'
if [[ '${{matrix.platform}}' == 'common' ]]; then
./gradlew --no-daemon ":kbigint:$target" ":kbigint-serialization:$target"
else
./gradlew --no-daemon ":kbigint:$target"
fi
env:
GITHUB_TOKEN: ${{github.token}}
SIGNING_KEY: ${{secrets.SIGNING_KEY}}
SIGNING_PASSWORD: ${{secrets.SIGNING_PASSWORD}}
GRADLE_USER_HOME: ${{runner.tool_cache}}/gradle
KONAN_DATA_DIR: ${{runner.tool_cache}}/konan