forked from korlibs/korge
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (81 loc) · 4.75 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
name: DEPLOY
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
forced_version:
description: 'FORCED_VERSION to use'
required: true
type: string
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:
create-staging-repo:
runs-on: ubuntu-latest
outputs:
stagedRepositoryId: ${{ steps.createStagedRepositoryId.outputs.stagedRepositoryId }}
env:
DISABLE_JAVASCRIPT_TEST: true
DISABLE_KOTLIN_NATIVE: true
DISABLE_ANDROID: true
DISABLE_SANDBOX: true
steps:
- run: "echo FORCED_VERSION=$FORCED_VERSION"
- 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: Replace gradle wrapper, run: "sed 's/-all/-bin/g' gradle/wrapper/gradle-wrapper.properties > gradle/wrapper/gradle-wrapper.properties.bak; cp gradle/wrapper/gradle-wrapper.properties.bak gradle/wrapper/gradle-wrapper.properties" }
- { name: Prepare Gradle, uses: gradle/gradle-build-action@ef76a971e2fa3f867b617efd72f2fbd72cf6f8bc } # v2.8.0
- run: sudo apt-get install xvfb
- id: createStagedRepositoryId
run: xvfb-run --auto-servernum ./gradlew --no-daemon --info --stacktrace startReleasingMavenCentral
publish:
strategy:
fail-fast: false # Once working, comment this
matrix:
include:
- { os: macos-11, tasks: publishIosArm64PublicationToMavenRepository publishIosX64PublicationToMavenRepository publishIosSimulatorArm64PublicationToMavenRepository }
- { os: macos-11, tasks: publishTvosX64PublicationToMavenRepository publishTvosArm64PublicationToMavenRepository publishTvosSimulatorArm64PublicationToMavenRepository }
- { os: macos-11, tasks: publishMacosX64PublicationToMavenRepository publishMacosArm64PublicationToMavenRepository }
- { os: ubuntu-latest, tasks: publishKotlinMultiplatformPublicationToMavenRepository publishJvmPublicationToMavenRepository }
- { os: ubuntu-latest, tasks: publishWasmJsPublicationToMavenRepository publishJsPublicationToMavenRepository publishAndroidPublicationToMavenRepository }
- { os: ubuntu-latest, tasks: publishMingwX64PublicationToMavenRepository publishLinuxX64PublicationToMavenRepository publishLinuxArm64PublicationToMavenRepository }
runs-on: ${{ matrix.os }}
needs: [create-staging-repo]
env:
stagedRepositoryId: ${{needs.create-staging-repo.outputs.stagedRepositoryId}}
steps:
- 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: Replace gradle wrapper, run: "sed 's/-all/-bin/g' gradle/wrapper/gradle-wrapper.properties > gradle/wrapper/gradle-wrapper.properties.bak; cp gradle/wrapper/gradle-wrapper.properties.bak gradle/wrapper/gradle-wrapper.properties" }
- { name: Prepare Gradle, uses: gradle/gradle-build-action@ef76a971e2fa3f867b617efd72f2fbd72cf6f8bc } # v2.8.0
#- run: sudo apt-get install xvfb
#- run: xvfb-run --auto-servernum ./gradlew --no-daemon checkReleasingMavenCentral
- run: ./gradlew checkReleasingMavenCentral
- run: ./gradlew ${{ matrix.tasks }}
publish-finalize:
runs-on: ubuntu-latest
needs: [publish]
env:
stagedRepositoryId: ${{needs.create-staging-repo.outputs.stagedRepositoryId}}
DISABLE_JAVASCRIPT_TEST: true
DISABLE_KOTLIN_NATIVE: true
DISABLE_ANDROID: true
DISABLE_SANDBOX: true
steps:
- 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: Replace gradle wrapper, run: "sed 's/-all/-bin/g' gradle/wrapper/gradle-wrapper.properties > gradle/wrapper/gradle-wrapper.properties.bak; cp gradle/wrapper/gradle-wrapper.properties.bak gradle/wrapper/gradle-wrapper.properties" }
- { name: Prepare Gradle, uses: gradle/gradle-build-action@ef76a971e2fa3f867b617efd72f2fbd72cf6f8bc } # v2.8.0
- run: ./gradlew releaseMavenCentral