-
Notifications
You must be signed in to change notification settings - Fork 2
195 lines (167 loc) · 5.52 KB
/
build.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
186
187
188
189
190
191
192
193
194
195
name: build
on:
pull_request:
branches: ['*']
push:
branches: ['*']
tags: ["v[0-9]+*"]
jobs:
jvm-tests:
name: JVM (scala ${{ matrix.scala }}, jvm ${{ matrix.java }})
strategy:
fail-fast: true
matrix:
os: [ubuntu-20.04]
java: [8, 11]
scala: [2.12.14, 2.13.6, 3.0.2]
command: ["ci-jvm"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v11
with:
java-version: "adopt@1.${{ matrix.java }}"
- name: sbt ++${{ matrix.scala }} ${{ matrix.command }}
run: |
./.github/scripts/build.sh
env:
SCALA_VERSION: ${{ matrix.scala }}
SBT_COMMAND: ${{ matrix.command }}
js-tests:
name: JS (scala ${{ matrix.scala }}, scala.js ${{ matrix.scalajs }}, jvm ${{ matrix.java }})
strategy:
fail-fast: true
matrix:
os: [ubuntu-20.04]
java: [11]
scala: [2.12.14, 2.13.6, 3.0.2]
scalajs: [1.7.0]
command: [ci-js]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v11
with:
java-version: "adopt@1.${{ matrix.java }}"
- name: sbt ++${{ matrix.scala }} ${{ matrix.command }}
run: |
./.github/scripts/build.sh
env:
SCALA_VERSION: ${{ matrix.scala }}
SCALAJS_VERSION: ${{ matrix.scalaJS }}
SBT_COMMAND: ${{ matrix.command }}
package-tests:
name: Package (scala ${{ matrix.scala }}, scala.js ${{ matrix.scalajs }}, jvm ${{ matrix.java }})
strategy:
fail-fast: true
matrix:
os: [ubuntu-20.04]
java: [11]
scala: [2.12.14, 2.13.6, 3.0.2]
scalajs: [1.7.0]
command: [ci-package]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v11
with:
java-version: "adopt@1.${{ matrix.java }}"
- name: sbt ++${{ matrix.scala }} ${{ matrix.command }}
run: |
./.github/scripts/build.sh
env:
SCALA_VERSION: ${{ matrix.scala }}
SCALAJS_VERSION: ${{ matrix.scalaJS }}
SBT_COMMAND: ${{ matrix.command }}
doc-tests:
name: Docs (scala ${{ matrix.scala }}, scala.js ${{ matrix.scalajs }}, jvm ${{ matrix.java }})
strategy:
fail-fast: true
matrix:
os: [ubuntu-20.04]
java: [11]
scala: [2.13.6]
scalajs: [1.7.0]
command: ["ci-doc"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v11
with:
java-version: "adopt@1.${{ matrix.java }}"
- name: Set up Ruby 2.7 (for microsite)
uses: actions/setup-ruby@v1
with:
ruby-version: 2.7.x
- name: Install microsite dependencies
run: |
bundle install --system --gemfile=site/Gemfile
- name: sbt ++${{ matrix.scala }} ${{ matrix.command }}
run: |
./.github/scripts/build.sh
env:
SCALA_VERSION: ${{ matrix.scala }}
SCALAJS_VERSION: ${{ matrix.scalaJS }}
SBT_COMMAND: ${{ matrix.command }}
#-----------------------------------------------------------------------------------
# Publishing tasks
#-----------------------------------------------------------------------------------
publish_sonatype:
name: Publish to Sonatype
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [ jvm-tests, js-tests, package-tests, doc-tests ]
strategy:
fail-fast: true
max-parallel: 1
matrix:
scalajs: ["", 1.7.0]
command: [ci-release]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- uses: olafurpg/setup-scala@v11
with:
java-version: "[email protected]"
- name: Install GnuPG2
run: |
sudo apt-get update && sudo apt-get -y install gnupg2
mkdir ~/.gnupg && chmod 700 ~/.gnupg
echo use-agent >> ~/.gnupg/gpg.conf
echo pinentry-mode loopback >> ~/.gnupg/gpg.conf
echo allow-loopback-pinentry >> ~/.gnupg/gpg-agent.conf
chmod 600 ~/.gnupg/*
echo RELOADAGENT | gpg-connect-agent
echo $PGP_SECRET | base64 --decode | gpg --import --no-tty --batch --yes
env:
PGP_SECRET: ${{secrets.PGP_SECRET}}
- name: SCALAJS_VERSION=${{ matrix.scalajs }} sbt ci-release
run: |
echo "SCALAJS_VERSION=$SCALAJS_VERSION"
sbt +clean ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SCALAJS_VERSION: ${{ matrix.scalaJS }}
publish_microsite:
name: Publish Website
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [ publish_sonatype ]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- uses: olafurpg/setup-scala@v11
with:
java-version: "[email protected]"
- name: Set up Ruby 2.7 (for microsite)
uses: actions/setup-ruby@v1
with:
ruby-version: 2.7.x
- name: Install microsite dependencies
run: |
bundle install --system --gemfile=site/Gemfile
- name: Publish Website
run: sbt +clean site/publishMicrosite
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}