-
Notifications
You must be signed in to change notification settings - Fork 1
139 lines (137 loc) · 4.9 KB
/
ci.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Build & Test
on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
jobs:
build:
name: Build & Test
runs-on: macos-13
steps:
- name: Checkout workspace
uses: actions/checkout@v3
timeout-minutes: 5
with:
fetch-depth: 0 # no shallow clones for SonarQube
- name: Set up Java JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17.0.10+7'
- name: Select XCode 15.2
run: |
sudo xcode-select -s /Applications/Xcode_15.2.app/Contents/Developer
xcodebuild -version
- name: Gradle Cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.gradle/native
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties', 'build.gradle.kts') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Kotlin Native Cache
uses: actions/cache@v3
with:
path: ~/.konan
key: ${{ runner.os }}-konan-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties', 'build.gradle.kts') }}
restore-keys: ${{ runner.os }}-konan-
- name: Android Cache
uses: actions/cache@v3
with:
path: ~/.android
key: ${{ runner.os }}-android-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties', 'build.gradle.kts') }}
restore-keys: ${{ runner.os }}-android-
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Build & Test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
chmod +x ./gradlew
./gradlew build test koverXmlReport detekt sonar assembleXCFramework --parallel
- name: Set RELEASE_VERSION variable
run: |
echo "RELEASE_VERSION=$(cat build/version.txt)" >> $GITHUB_ENV
echo ${{ env.RELEASE_VERSION }}
- name: Upload reports
uses: actions/upload-artifact@v3
if: always()
with:
name: reports.zip
path: build/reports
- name: List files
run: |
ls -lah build/bin/*/releaseExecutable build/libs/ build/outputs/aar/ build/XCFrameworks/release/
- name: Upload xmpcore.jar
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: xmpcore.jar
path: build/libs/xmpcore-jvm-${{ env.RELEASE_VERSION }}.jar
- name: Upload xmpcore.aar
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: xmpcore.aar
path: build/outputs/aar/xmpcore-release.aar
- name: Upload xmpcore.xcframework
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: xmpcore.xcframework
path: build/XCFrameworks/release/xmpcore.xcframework
- name: Upload xmpcore.exe
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: xmpcore.exe
path: build/bin/win/releaseExecutable/xmpcore.exe
- name: Upload xmpcore-macosX64.kexe
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: xmpcore-macosX64.kexe
path: build/bin/macosX64/releaseExecutable/xmpcore.kexe
- name: Upload xmpcore-macosArm64.kexe
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: xmpcore-macosArm64.kexe
path: build/bin/macosArm64/releaseExecutable/xmpcore.kexe
- name: Upload xmpcore-linuxArm64.kexe
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: xmpcore-linuxArm64.kexe
path: build/bin/linuxArm64/releaseExecutable/xmpcore.kexe
- name: Upload xmpcore-linuxX64.kexe
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: xmpcore-linuxX64.kexe
path: build/bin/linuxX64/releaseExecutable/xmpcore.kexe
- name: Export secring.pgp
if: startsWith(github.ref, 'refs/tags/') # Only for releases
run: |
echo ${{ secrets.SINGING_SECRET_KEY_RING_FILE_CONTENTS }} | base64 --decode > secring.pgp
- name: Publish to Maven Central
if: startsWith(github.ref, 'refs/tags/') # Only for releases
env:
SIGNING_ENABLED: true
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: ./gradlew publishAllPublicationsToSonatypeRepository