-
Notifications
You must be signed in to change notification settings - Fork 95
106 lines (105 loc) · 3.83 KB
/
publish.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
name: Publish
on:
workflow_call:
inputs:
should_run:
description: "Indicates if the job should be run"
required: true
type: boolean
nussknacker_version:
description: "Version that will be published"
required: true
type: string
git_source_branch:
description: "Source branch"
required: true
type: string
secrets:
sonatype_user:
required: true
sonatype_password:
required: true
github__token:
required: true
dockerhub_user:
required: true
dockerhub_token:
required: true
jobs:
publish:
runs-on: ubuntu-latest
if: ${{ inputs.should_run }}
env:
nexusUrl: https://oss.sonatype.org/content/repositories/snapshots
addDevArtifacts: true
NUSSKNACKER_VERSION: ${{ inputs.nussknacker_version }}
GIT_SOURCE_BRANCH: ${{ inputs.git_source_branch }}
SONATYPE_USERNAME: ${{ secrets.sonatype_user }}
SONATYPE_PASSWORD: ${{ secrets.sonatype_password }}
steps:
- name: Cancel previous runs
if: github.event_name != 'push'
uses: styfle/[email protected]
with:
access_token: ${{ secrets.github__token }}
- uses: actions/checkout@v3
- uses: coursier/setup-action@v1
with:
jvm: temurin:1.11.0.17
- name: Cache ivy packages
uses: actions/cache@v3
with:
path: |
~/.ivy2/cache
~/.cache/coursier
~/.sbt
key: sbt-cache-${{ hashFiles('**/*.sbt') }}
restore-keys: sbt
- uses: actions/download-artifact@v4
with:
name: build-target
- name: Untar artifacts
shell: bash
run: tar xfz target.tgz
- uses: actions/download-artifact@v4
with:
name: build-fe-dist
- name: Untar fe artifacts
shell: bash
run: tar xfz fe-dist.tgz
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.dockerhub_user }}
password: ${{ secrets.dockerhub_token }}
- name: Setup buildx builder
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
config-inline: |
[worker.oci]
max-parallelism = 1
- name: Try to free space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf /usr/local/lib/android
- uses: sbt/setup-sbt@v1
- name: Publish with scaladocs
if: ${{ inputs.ref == 'refs/heads/staging' }}
env:
# Workaround to preveent "no space left on device" during publishDocker failed to create temp dir: mkdir /tmp/containerd-mountXYZ
TMPDIR: ${{ github.workspace }}
shell: bash
#TODO: handle version better, do we want to publish docker image for older scala versions? If so, how should it be tagged?
run: sbt "set ThisBuild / version := \"$NUSSKNACKER_VERSION\"" +publish +dist/Docker/publish +liteEngineRuntimeApp/Docker/publish
- name: Publish without scaladocs
if: ${{ inputs.ref != 'refs/heads/staging' }}
env:
# Workaround to preveent "no space left on device" during publishDocker failed to create temp dir: mkdir /tmp/containerd-mountXYZ
TMPDIR: ${{ github.workspace }}
shell: bash
#TODO: handle version better, do we want to publish docker image for older scala versions? If so, how should it be tagged?
run: sbt "set ThisBuild / version := \"$NUSSKNACKER_VERSION\"; set ThisBuild / packageDoc / publishArtifact := false; set Compile / doc / sources := Seq.empty" +publish +dist/Docker/publish +liteEngineRuntimeApp/Docker/publish