-
Notifications
You must be signed in to change notification settings - Fork 0
185 lines (166 loc) · 5.59 KB
/
main.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
tags:
- 'v*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: self-hosted
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'
- uses: actions/cache@v2
with:
path: |
./.gradle/
~/.gradle/caches
~/.gradle/wrapper
~/.konan/
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle
- name: Build with Gradle
run: ./gradlew build
- name: Publish libs as artifacts
uses: actions/upload-artifact@v3
with:
name: Package
path: build/libs
test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'
- uses: actions/cache@v2
with:
path: |
./.gradle/
~/.gradle/caches
~/.gradle/wrapper
~/.konan/
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle
# - name: Test JVM with Gradle
# if: always()
# run: ./gradlew :jvmTest -i
#
# - name: Test JS with Gradle
# if: always()
# run: ./gradlew :jsNodeTest -i
#
# - name: Test Native with Gradle
# if: always()
# run: ./gradlew :nativeTest -i
- name: Upload Unit Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: Unit Test Results
path: /home/runner/work/ko-te/ko-te/build/test-results/**/*.xml
publish:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'
- uses: actions/cache@v2
with:
path: |
./.gradle/
~/.gradle/caches
~/.gradle/wrapper
~/.konan/
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle
- name: Import GPG Key
run: |
echo '${{secrets.GPG_SIGNING_KEY}}' | base64 -d > publish_key.gpg
gpg --quiet --batch --yes --decrypt --passphrase="${{secrets.SECRET_PASSPHRASE}}" \
--output $GITHUB_WORKSPACE/release.gpg publish_key.gpg
- name: Publish to GitHub Packages
run: |
./gradlew publish \
-Psigning.secretKeyRingFile=$GITHUB_WORKSPACE/release.gpg \
-Psigning.password=${{ secrets.GPG_PASSWORD }} \
-Psigning.keyId=${{ secrets.GPG_KEY_ID }}
env:
REPO_USERNAME: ${{ github.actor }}
REPO_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
publish-maven-central:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'
- uses: actions/cache@v2
with:
path: |
./.gradle/
~/.gradle/caches
~/.gradle/wrapper
~/.konan/
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle
- name: Import GPG Key
run: |
echo '${{secrets.GPG_SIGNING_KEY}}' | base64 -d > publish_key.gpg
gpg --quiet --batch --yes --decrypt --passphrase="${{secrets.SECRET_PASSPHRASE}}" \
--output $GITHUB_WORKSPACE/release.gpg publish_key.gpg
- name: Publish to Maven Central
run: |
./gradlew publish \
-Psigning.secretKeyRingFile=$GITHUB_WORKSPACE/release.gpg \
-Psigning.password=${{ secrets.GPG_PASSWORD }} \
-Psigning.keyId=${{ secrets.GPG_KEY_ID }}
env:
REPO_URI: https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
REPO_USERNAME: ${{ secrets.OSSRH_USERNAME }}
REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
publish-test-results:
name: "Publish Unit Tests Results"
needs: test
runs-on: ubuntu-latest
if: always()
steps:
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
with:
files: artifacts/**/*.xml