-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (55 loc) · 1.75 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
name: CI
on:
push:
branches: [ master ]
tags: [ '*.*.*' ]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/cache@v2
with:
path: |
~/.sbt
~/.cache/coursier/v1
~/.ivy2/cache
key: ${{ runner.os }}-build-cache-${{ hashFiles('*.sbt') }}-${{ hashFiles('project/*') }}
- uses: olafurpg/setup-scala@v10
with:
java-version: [email protected]
- run: sbt scalafmtCheckAll scalafmtSbtCheck test publishLocal
publish:
runs-on: ubuntu-latest
needs: build
if: github.repository == 'rtimush/zio-magic-comments' && ( github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') )
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/cache@v2
with:
path: |
~/.sbt
~/.cache/coursier/v1
~/.ivy2/cache
key: ${{ runner.os }}-publish-cache-${{ hashFiles('*.sbt') }}-${{ hashFiles('project/*') }}
- uses: crazy-max/ghaction-import-gpg@v3
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }}
- uses: olafurpg/setup-scala@v10
with:
java-version: [email protected]
- 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 }}