-
Notifications
You must be signed in to change notification settings - Fork 22
82 lines (69 loc) · 2.33 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
name: Scala CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Pull all history with tags for correct versionning
run: git fetch --prune --unshallow
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Cache SBT ivy cache
uses: actions/cache@v1
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/build.sc') }}
restore-keys: |
${{ runner.os }}-sbt-ivy-cache-
- name: Cache SBT
uses: actions/cache@v1
with:
path: ~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sc') }}
restore-keys: |
${{ runner.os }}-sbt-
- name: Cache Mill
uses: actions/cache@v1
with:
path: ~/.cache/mill
key: ${{ runner.os }}-mill-${{ hashFiles('**/build.sc') }}
restore-keys: |
${{ runner.os }}-mill-
- name: Cache Coursier
uses: actions/cache@v1
with:
path: ~/.cache/coursier
key: ${{ runner.os }}-coursier-${{ hashFiles('**/build.sc') }}
restore-keys: |
${{ runner.os }}-coursier-
- name: Cache Out
uses: actions/cache@v1
with:
path: ./out
key: ${{ runner.os }}-out-${{ hashFiles('**/build.sc') }}
restore-keys: |
${{ runner.os }}-out-
- name: Checks
run: |
git config --global user.name "CI"
./mill all __.checkFormat __.docJar __.test
# ./mill all __.checkFormat "__.fix --check" __.docJar __.test
- name: Status Check
run: |
git status
- name: Publish
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') || github.event_name == 'release'
run: |
echo "${{ secrets.PGP_SECRET }}" > private.key
gpg --batch --yes --import private.key
rm private.key
./mill mill.scalalib.PublishModule/publishAll --sonatypeCreds ${{ secrets.SONATYPE_USERNAME }}:${{ secrets.SONATYPE_PASSWORD }} --gpgArgs --passphrase,${{ secrets.PGP_PASSPHRASE }},--batch,--yes,-a,-b,--pinentry-mode,loopback --publishArtifacts __.publishArtifacts --awaitTimeout 900000 --readTimeout 600000 --release true