-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (75 loc) · 2.21 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
name: Continuous Integration
on:
pull_request:
branches: [ '**' ]
push:
branches: [ master ]
tags: [ "*" ]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
name: Build and Test
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
distribution: temurin
java: 17
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "${{ matrix.distribution }}"
java-version: "${{ matrix.java }}"
- name: Setup sbt
uses: sbt/setup-sbt@v1
- name: Build project
run: sbt -v scalafmtCheckAll test scripted
env:
PROTOFETCH_GIT_PROTOCOL: https
- name: Compress target directories
run: tar cf targets.tar target sbt-protofetch/target project/target
- name: Upload target directories
uses: actions/upload-artifact@v4
with:
name: target-${{ matrix.java }}
path: targets.tar
publish:
name: Publish Artifacts
needs: [ build ]
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master')
runs-on: ubuntu-latest
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Java (temurin@17)
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Setup sbt
uses: sbt/setup-sbt@v1
- name: Download target directories
uses: actions/download-artifact@v4
with:
name: target-17
- name: Inflate target directories
run: |
tar xf targets.tar
rm targets.tar
- name: Publish project
run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}