forked from zxing-cpp/zxing-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (62 loc) · 2.24 KB
/
publish-kn.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
name: publish-kn
on:
workflow_dispatch:
inputs:
publish:
description: 'Publish package (y/n)'
default: 'n'
jobs:
publish:
name: Library Publish
runs-on: macos-13 # at least macos-13 is required to enable c++20 support
defaults:
run:
working-directory: ./wrappers/kn
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Checkout toolchain initializer repository
uses: actions/checkout@v4
with:
repository: ISNing/kn-toolchain-initializer
path: wrappers/kn/.kn-toolchain-initializer
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v2
- name: Initialize Kotlin/Native toolchain
working-directory: wrappers/kn/.kn-toolchain-initializer
run: ./gradlew build -DkotlinVersion=1.9.22
- name: Export Toolchain properties
run: |
echo -e "konan.dir=$HOME/.konan/kotlin-native-prebuilt-macos-x86_64-1.9.22" > local.properties
- name: Build Library
run: |
export PATH="$PATH:$(brew --prefix llvm@15)/bin"
./gradlew assemble
- name: Run All Library Tests
run: |
export PATH="$PATH:$(brew --prefix llvm@15)/bin"
./gradlew allTests
- name: Upload Library Test Reports
uses: actions/upload-artifact@v4
with:
name: allTests-reports
path: wrappers/kn/build/reports/tests/allTests
- name: Publish Library
if: ${{ github.event.inputs.publish == 'y' }}
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }}
run: |
export PATH="$PATH:$(brew --prefix llvm@15)/bin"
./gradlew publishAllPublicationsToSonatypeRepository