-
-
Notifications
You must be signed in to change notification settings - Fork 55
103 lines (101 loc) · 3.02 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: CI
on:
push:
branches: [master]
tags: ["*.*.*"]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache@v4
with:
path: |
~/.sbt
~/.cache/coursier/v1
~/.ivy2/cache
key: ${{ runner.os }}-build-cache-${{ hashFiles('*.sbt') }}-${{ hashFiles('project/*') }}
- uses: actions/setup-java@v4
with:
java-version: "8"
distribution: zulu
- run: sbt scalafmtCheckAll scalafmtSbtCheck test publishLocal
- uses: actions/upload-artifact@v3
with:
name: sbt-updates
path: /home/runner/.ivy2/local
scripted:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
include:
- { sbt: 1_0_0, java: 8 }
- { sbt: latest, java: 8 }
- { sbt: 1_0_0, java: 11 }
- { sbt: latest, java: 11 }
- { sbt: latest, java: 14 }
fail-fast: false
name: test (java ${{ matrix.java }}, sbt ${{ matrix.sbt }})
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache@v4
with:
path: |
~/.sbt
~/.cache/coursier/v1
~/.ivy2/cache
key: ${{ runner.os }}-scripted-cache-${{ matrix.sbt }}-${{ hashFiles('*.sbt') }}-${{ hashFiles('project/*') }}
- uses: actions/download-artifact@v3
with:
name: sbt-updates
path: /home/runner/.ivy2/local
- uses: actions/setup-java@v4
with:
java-version: "${{ matrix.java }}"
distribution: zulu
- run: sbt sbt-updates-${{ matrix.sbt }}/scripted
env:
CI: "true"
test:
runs-on: ubuntu-latest
needs: scripted
steps:
- run: "true"
publish:
runs-on: ubuntu-latest
needs: test
if: github.repository == 'rtimush/sbt-updates' && ( github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') )
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache@v4
with:
path: |
~/.sbt
~/.cache/coursier/v1
~/.ivy2/cache
key: ${{ runner.os }}-publish-cache-${{ hashFiles('*.sbt') }}-${{ hashFiles('project/*') }}
- uses: crazy-max/ghaction-import-gpg@v6.1.0
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }}
- uses: actions/setup-java@v4
with:
java-version: "8"
distribution: zulu
- run: sbt publishSigned
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
- if: startsWith(github.ref, 'refs/tags/')
run: sbt sonatypeBundleRelease
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}