generated from korlibs/korlibs-library-template
-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (82 loc) · 5.42 KB
/
DEPLOY.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: DEPLOY
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
forced_version:
description: 'FORCED_VERSION to use'
required: true
type: string
#permissions:
# contents: write
# discussions: write
env:
CI: true
FORCED_VERSION: ${{ inputs.forced_version || github.ref }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPEUSERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPEPASSWORD }}
JAVA_VERSION: 17
JAVA_DISTRIBUTION: zulu
jobs:
##start:
## runs-on: ubuntu-latest
## outputs:
## stagedRepositoryId: ${{ steps.releaseStep.outputs.stagedRepositoryId }}
## steps:
## - { name: Checkout, uses: actions/checkout@v3 }
## - { name: Set up JDK, uses: actions/setup-java@v3, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } }
## - { name: Prepare Gradle, uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 } # https://github.com/gradle/actions/releases/tag/v3.5.0
## - { id: releaseStep, name: Start Maven Central Staging Repository, run: ./gradlew --no-configuration-cache startReleasingMavenCentral }
publish:
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-latest, publishTask: "publishLinuxX64PublicationToMavenLocal publishLinuxArm64PublicationToMavenLocal" }
- { os: ubuntu-latest, publishTask: "publishMingwX64PublicationToMavenLocal" }
- { os: ubuntu-latest, publishTask: "publishAndroidDebugPublicationToMavenLocal publishAndroidReleasePublicationToMavenLocal" }
- { os: ubuntu-latest, publishTask: "publishKotlinMultiplatformPublicationToMavenLocal publishJvmPublicationToMavenLocal" }
- { os: ubuntu-latest, publishTask: "publishJsPublicationToMavenLocal publishWasmJsPublicationToMavenLocal" }
- { os: macos-13, publishTask: "publishMacosX64PublicationToMavenLocal publishMacosArm64PublicationToMavenLocal" }
- { os: macos-13, publishTask: "publishTvosArm64PublicationToMavenLocal publishTvosSimulatorArm64PublicationToMavenLocal publishTvosX64PublicationToMavenLocal" }
- { os: macos-13, publishTask: "publishIosArm64PublicationToMavenLocal publishIosSimulatorArm64PublicationToMavenLocal publishIosX64PublicationToMavenLocal" }
- { os: macos-13, publishTask: "publishWatchosArm64PublicationToMavenLocal publishWatchosArm32PublicationToMavenLocal publishWatchosDeviceArm64PublicationToMavenLocal publishWatchosSimulatorArm64PublicationToMavenLocal" }
timeout-minutes: 300
runs-on: ${{ matrix.os }}
##needs: [start]
##env: { stagedRepositoryId: "${{ needs.start.outputs.stagedRepositoryId }}" }
steps:
##- { name: Print stagedRepositoryId=$stagedRepositoryId, run: "echo 'stagedRepositoryId: $stagedRepositoryId'" }
- name: Replace MavenLocal with MavenLocal
id: replace
run: |
publishTaskLocal=$(echo "${{ matrix.publishTask }}" | tr -d '\n')
publishTaskRepository=$(echo "${{ matrix.publishTask }}" | sed 's/MavenLocal/MavenRepository/g' | tr -d '\n')
echo "publishTaskLocal=${publishTaskLocal}" >> $GITHUB_ENV
echo "publishTaskRepository=${publishTaskRepository}" >> $GITHUB_ENV
- { name: Print publishTaskLocal, run: "echo 'publishTaskLocal: ${{ env.publishTaskLocal }}'" }
- { name: Print publishTaskRepository, run: "echo 'publishTaskRepository: ${{ env.publishTaskRepository }}'" }
- { name: Checkout, uses: actions/checkout@v3 }
- { name: Use Node.js 20.x, uses: actions/setup-node@v3, with: { node-version: 20.x } }
- { name: Set up JDK, uses: actions/setup-java@v3, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } }
- { name: Prepare Gradle, uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 } # https://github.com/gradle/actions/releases/tag/v3.5.0
- { name: Initialize Gradle, run: ./gradlew --no-configuration-cache }
- { name: Publish Publications To Maven Local, run: "./gradlew --no-configuration-cache --parallel ${{ env.publishTaskLocal }}" }
- { name: Start Maven Central Staging Repository, run: ./gradlew --no-configuration-cache startReleasingMavenCentral }
- { name: Publish Publications To Maven Repository, run: "./gradlew --no-configuration-cache --parallel --max-workers=8 ${{ env.publishTaskRepository }}" }
- { name: Release to Maven Central, run: ./gradlew --no-configuration-cache releaseMavenCentral }
##finalize:
## runs-on: ubuntu-latest
## needs: [start, publish]
## env: { stagedRepositoryId: "${{ needs.start.outputs.stagedRepositoryId }}" }
## steps:
## - { name: Checkout, uses: actions/checkout@v3 }
## - { name: Use Node.js 20.x, uses: actions/setup-node@v3, with: { node-version: 20.x } }
## - { name: Set up JDK, uses: actions/setup-java@v3, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } }
## - { name: Prepare Gradle, uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 } # https://github.com/gradle/actions/releases/tag/v3.5.0
## - { name: Initialize Gradle, run: ./gradlew --no-configuration-cache }
## - { name: Release to Maven Central, run: ./gradlew --no-configuration-cache releaseMavenCentral }