-
Notifications
You must be signed in to change notification settings - Fork 422
134 lines (124 loc) · 4.49 KB
/
publish-release.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Publish Release
on:
release:
types: [published]
jobs:
publish-node-image:
name: Publish node image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
cache: 'sbt'
- uses: sbt/setup-sbt@v1
- run: sbt --mem 4096 --batch ';buildTarballsForDocker;buildRIDERunnerForDocker'
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- id: meta-public
uses: docker/metadata-action@v5
with:
images: wavesplatform/wavesnode
flavor: latest=false
tags: |
type=match,pattern=v(.*),group=1
type=raw,value=latest,enable=${{ github.event.release.prerelease == false }}
- id: meta-private
uses: docker/metadata-action@v5
with:
images: wavesplatform/waves-private-node
flavor: latest=false
tags: |
type=ref,event=tag
type=raw,value=latest,enable=${{ github.event.release.prerelease == false }}
- id: meta-ride-runner
uses: docker/metadata-action@v5
with:
images: wavesplatform/ride-runner
flavor: latest=false
tags: |
type=match,pattern=v(.*),group=1
type=raw,value=latest,enable=${{ github.event.release.prerelease == false }}
- uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
context: ./docker
push: true
pull: true
tags: ${{ steps.meta-public.outputs.tags }}
- uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
context: ./docker/private
push: true
pull: true
tags: ${{ steps.meta-private.outputs.tags }}
build-args: |
NODE_TAG=${{ steps.meta-public.outputs.version }}
- uses: docker/build-push-action@v5
with:
context: ./ride-runner/docker
push: true
pull: true
tags: ${{ steps.meta-ride-runner.outputs.tags }}
publish-node-sbt-builder-image:
name: Publish node SBT builder image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: extract-versions
run: |
echo "waves-version=$(cut -d\" -f2 version.sbt)" >> $GITHUB_OUTPUT
echo "sbt-version=$(cut -d= -f2 project/build.properties)" >> $GITHUB_OUTPUT
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
context: ./docker
file: ./docker/node-sbt-builder.Dockerfile
push: true
pull: true
tags: wavesplatform/node-sbt-builder:${{ steps.extract-versions.outputs.waves-version }}
build-args: |
WAVES_VERSION=${{ steps.extract-versions.outputs.waves-version }}
SBT_VERSION=${{ steps.extract-versions.outputs.sbt-version }}
publish-release-jars:
name: Publish jars to Sonatype
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: sbt-version
run: |
sbt_version=$(cut -d\" -f2 version.sbt)
echo "sbt_version=$sbt_version" >> "$GITHUB_OUTPUT"
- if: ${{ format('v{0}', steps.sbt-version.outputs.sbt_version) != github.ref_name }}
env:
SBT_VERSION: ${{ steps.sbt-version.outputs.sbt_version }}
RELEASE_VERSION: ${{ github.ref_name }}
run: |
echo "::error::Release version $RELEASE_VERSION does not match SBT version $SBT_VERSION"
exit 1
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
cache: 'sbt'
gpg-private-key: ${{ secrets.OSSRH_GPG_KEY }}
gpg-passphrase: ${{ secrets.OSSRH_GPG_PASSPHRASE }}
- uses: sbt/setup-sbt@v1
- name: Publish release jars
env:
SONATYPE_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.OSSRH_USERNAME }}
PGP_PASSPHRASE: ${{ secrets.OSSRH_GPG_PASSPHRASE }}
run: |
sbt --mem 4096 --batch ";publishSigned;sonatypeBundleRelease"