-
-
Notifications
You must be signed in to change notification settings - Fork 60
/
config.yml
116 lines (116 loc) · 3.64 KB
/
config.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
version: 2.1
orbs:
gradle: circleci/gradle@3.0.0
browser-tools: circleci/browser-tools@1.4.6
_defaults: &defaults
working_directory: ~/code
environment:
JVM_OPTS: -Xmx4G
commands:
with_cache:
description: "Caches and restores gradle dependencies"
parameters:
cache_key:
type: string
default: v1
steps:
type: steps
steps:
- restore_cache:
key: >-
gradle-cache-<< parameters.cache_key >>-{{ checksum "gradle/libs.versions.toml" }}-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}
- restore_cache:
key: >-
konan-<< parameters.cache_key >>-{{ checksum "gradle/libs.versions.toml" }}-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}
- steps:
<< parameters.steps >>
- save_cache:
key: >-
gradle-cache-<< parameters.cache_key >>-{{ checksum "gradle/libs.versions.toml" }}-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}
paths:
- ~/.gradle/caches
- ~/.gradle/wrapper
- save_cache:
key: >-
konan-<< parameters.cache_key >>-{{ checksum "gradle/libs.versions.toml" }}-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}
paths:
- ~/.konan
gradle_publish:
description: "Publishes to sonatype/maven central"
parameters:
publish_task:
type: string
default: publish
steps:
- run:
command: |
if [ "${CIRCLE_BRANCH}" == "main" ]; then
echo "$MAVEN_CENTRAL_SEC_RING" | base64 -d > $HOME/secring.gpg
./gradlew << parameters.publish_task >> -PsonatypeUsername="$SONATYPE_USERNAME" -PsonatypePassword="$SONATYPE_PASSWORD" -Psigning.keyId=34BCD878 -Psigning.password="$MAVEN_CENTRAL_KEY_PASSPHRASE" -Psigning.secretKeyRingFile=$HOME/secring.gpg --no-parallel
fi
jobs:
build-linux:
docker:
- image: cimg/openjdk:22.0.2-browsers@sha256:6a2c48853a3693d1673ae10a0146c999de37d810cc507ef085ec7f15e03396e5
resource_class: large
<<: *defaults
steps:
- checkout
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- with_cache:
cache_key: linux
steps:
- run:
name: Build
command: ./gradlew assemble
- run:
name: Run Tests
command: ./gradlew check --continue
- gradle/collect_test_results:
test_results_path: build/test-results
reports_path: build/reports
- gradle_publish
build-macos:
macos:
xcode: "16.0.0"
resource_class: macos.m1.medium.gen1
<<: *defaults
steps:
- checkout
- with_cache:
cache_key: macos
steps:
- run:
name: Build
command: ./gradlew assemble
- run:
name: Run Tests
command: ./gradlew checkApple --continue
- gradle/collect_test_results:
test_results_path: build/test-results
reports_path: build/reports
- gradle_publish:
publish_task: publishApple
workflows:
version: 2
build:
jobs:
- build-linux:
filters:
branches:
ignore: main
- build-macos:
filters:
branches:
ignore: main
- build-linux:
context: opensource-maven
filters:
branches:
only: main
- build-macos:
context: opensource-maven
filters:
branches:
only: main