Skip to content

publish

publish #572

Workflow file for this run

name: publish
on:
workflow_dispatch:
inputs:
ref:
description: "The git branch, tag or SHA to checkout"
required: false
default: ''
type: string
workflow_run:
workflows: [ "build" ]
types:
- completed
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
permissions:
contents: read
jobs:
publish:
# only publish when
# * on the main repo,
# * if triggered by a workflow, the workflow was successful
if: >-
github.repository == 'Kantis/ks3'
&&
(!github.event.workflow_run || github.event.workflow_run.conclusion == 'success')
strategy:
max-parallel: 1 # Sonatype doesn't like parallel uploads, so disable it where possible
fail-fast: false
matrix:
include:
# Publish 'common' components (KotlinMultiplatform,jvm,js) only on Linux, to avoid duplicate publications
- os: ubuntu-latest
args: -P"ks3_enabledPublicationNamePrefixes=KotlinMultiplatform,jvm,js,linux"
# Windows: MinGW
- os: windows-latest
args: -P"ks3_enabledPublicationNamePrefixes=mingw"
# Apple: macOS, iOS, tvOS, watchOS
- os: macos-11
args: -P"ks3_enabledPublicationNamePrefixes=macOS,iOS,tvOS,watchOS"
uses: ./.github/workflows/gradle_task.yml
secrets: inherit
with:
ref: ${{ inputs.ref }}
gradle-task: publishAllPublicationsToSonatypeReleaseRepository ${{ matrix.args }} --no-parallel --stacktrace --no-configuration-cache
runs-on: ${{ matrix.os }}