-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (108 loc) · 3.23 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
name: build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/cache@v1
with:
path: ~/.cache/coursier/v1
key: ${{ runner.os }}-coursier-${{ hashFiles('**/build.sbt') }}
- name: Set up java
uses: actions/[email protected]
with:
distribution: adopt
java-version: 17
java-package: jre
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sbt compile
- name: Test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sbt test
- name: Build distributable
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sbt cmdJVM/stage
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push cmd images
uses: docker/build-push-action@v2
with:
context: cmd
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/torrentdam/cmd:latest
build-native:
if: false
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v1
- uses: actions/cache@v1
with:
path: ~/.cache/coursier/v1
key: ${{ runner.os }}-coursier-${{ hashFiles('**/build.sbt') }}
- name: Set up java
uses: actions/[email protected]
with:
distribution: adopt
java-version: 17
java-package: jre
- name: Build Native
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sbt -J-Xmx4g cmdNative/nativeLink
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push cmd images
uses: docker/build-push-action@v2
with:
context: cmd
file: cmd/Dockerfile-native
platforms: linux/amd64
push: true
tags: ghcr.io/torrentdam/cmd-native:latest
release:
if: startsWith(github.ref, 'refs/tags/v')
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up java
uses: actions/[email protected]
with:
distribution: adopt
java-version: 17
java-package: jre
- name: Release
env:
SONATYPE_CREDS: ${{ secrets.SONATYPE_CREDS }}
PGP_SECRET_KEY: ${{ secrets.PGP_SECRET_KEY }}
run: |
echo ${PGP_SECRET_KEY} | base64 --decode | gpg --import
gpg --list-secret-keys
export VERSION=${GITHUB_REF#*/v}
echo Publishing $VERSION
sbt commonJVM/publishSigned
sbt commonJS/publishSigned
sbt bittorrentJVM/publishSigned
sbt dhtJVM/publishSigned
sbt cmdJVM/publishSigned