-
Notifications
You must be signed in to change notification settings - Fork 147
183 lines (158 loc) · 5.92 KB
/
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
name: Release
on:
release:
types: [published]
jobs:
setup:
name: Setup repository
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Pull IOTA SDK bindings
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: 'iotaledger/iota-sdk-native-bindings'
# For now use 'latest'
#version: 'tags/v0.1.0'
regex: true
file: ".*"
target: 'sdk/'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Tar temporary artifacts
run: tar --exclude='temp.tar' -cf temp.tar ./
- name: Upload temporary artifacts
uses: actions/upload-artifact@v4
with:
name: wasp
path: temp.tar
retention-days: 1
- name: Set up Node
uses: actions/[email protected]
with:
node-version: "14"
- name: Install dependencies
run: npm install @slack/webhook
binaries:
needs: setup
name: Release wasp-cli Binaries
runs-on: ubuntu-latest
container:
image: iotaledger/goreleaser-cgo-cross-compiler:1.21.0
steps:
- name: Create dist folder
run: mkdir /dist && cd /dist/
- name: Download temporary artifacts
uses: actions/download-artifact@v4
with:
name: wasp
- name: Untar temporary artifacts, cleanup and set correct permissions
run: tar -xf temp.tar && rm temp.tar && chown -R root:root .
- name: Release wasp-cli
run: goreleaser --debug --clean -f ./tools/wasp-cli/.goreleaser.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-docker:
needs: setup
environment: release
name: Release Docker
runs-on: ubuntu-latest
outputs:
version: ${{ steps.tagger.outputs.tag }}
steps:
- name: Download temporary artifacts
uses: actions/download-artifact@v4
with:
name: wasp
- name: Untar temporary artifacts and cleanup
run: tar -xf temp.tar && rm temp.tar
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Query git tag
id: tagger
uses: jimschubert/query-tag-action@v2
with:
include: "v*"
exclude: ""
commit-ish: "HEAD"
skip-unshallow: "true"
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: iotaledger/wasp
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=match,pattern=v(\d+.\d+),suffix=-alpha,group=1,enable=${{ contains(github.ref, '-alpha') }}
type=match,pattern=v(\d+.\d+),suffix=-beta,group=1,enable=${{ contains(github.ref, '-beta') }}
type=match,pattern=v(\d+.\d+),suffix=-rc,group=1,enable=${{ contains(github.ref, '-rc') }}
- name: Extract CLI metadata (tags, labels) for Docker
id: meta-cli
uses: docker/metadata-action@v5
with:
images: iotaledger/sandbox-wasp-cli
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=match,pattern=v(\d+.\d+),suffix=-alpha,group=1,enable=${{ contains(github.ref, '-alpha') }}
type=match,pattern=v(\d+.\d+),suffix=-beta,group=1,enable=${{ contains(github.ref, '-beta') }}
type=match,pattern=v(\d+.\d+),suffix=-rc,group=1,enable=${{ contains(github.ref, '-rc') }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.IOTALEDGER_DOCKER_USERNAME }}
password: ${{ secrets.IOTALEDGER_DOCKER_PASSWORD }}
- name: Build and push WASP to Dockerhub
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }},iotaledger/wasp:latest
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_LD_FLAGS=-X=github.com/iotaledger/wasp/components/app.Version=${{ steps.tagger.outputs.tag }}
- name: Build and push WASP CLI to Dockerhub
uses: docker/build-push-action@v6
with:
context: .
file: ./tools/wasp-cli/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta-cli.outputs.tags }},iotaledger/sandbox-wasp-cli:latest
labels: ${{ steps.meta-cli.outputs.labels }}
build-args: |
BUILD_LD_FLAGS=-X=github.com/iotaledger/wasp/components/app.Version=${{ steps.tagger.outputs.tag }}
# Push wasp-cli README to Docker Hub
- name: git checkout
uses: actions/checkout@v4
- name: push README to Dockerhub
uses: christian-korneck/update-container-description-action@v1
env:
DOCKER_USER: ${{ secrets.IOTALEDGER_DOCKER_USERNAME }}
DOCKER_PASS: ${{ secrets.IOTALEDGER_DOCKER_PASSWORD }}
with:
destination_container_repo: iotaledger/sandbox-wasp-cli
provider: dockerhub
short_description: 'wasp-cli is a command line tool for interacting with IOTA Wasp and its smart contracts.'
readme_file: 'tools/wasp-cli/README.md'
release-iscmagic:
uses: ./.github/workflows/publish-iscmagic.yml
needs: release-docker
with:
version: ${{ needs.release-docker.outputs.version }}
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
release-iscutils:
uses: ./.github/workflows/publish-iscutils.yml
needs: release-docker
with:
version: ${{ needs.release-docker.outputs.version }}
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}