-
Notifications
You must be signed in to change notification settings - Fork 152
131 lines (111 loc) · 3.78 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
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: Tar temporary artifacts
run: tar --exclude='temp.tar' -cf temp.tar ./
- name: Upload temporary artifacts
uses: actions/upload-artifact@v3
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@v3
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
name: Release Docker
runs-on: ubuntu-latest
outputs:
version: ${{ steps.tagger.outputs.tag }}
steps:
- name: Download temporary artifacts
uses: actions/download-artifact@v3
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: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.IOTALEDGER_DOCKER_USERNAME }}
password: ${{ secrets.IOTALEDGER_DOCKER_PASSWORD }}
- name: Build and push to Dockerhub
uses: docker/build-push-action@v5
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 }}
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 }}