forked from stacks-network/stacks-core
-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (137 loc) · 4.42 KB
/
github-release.yml
File metadata and controls
144 lines (137 loc) · 4.42 KB
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
## Github workflow to create a github release and upload binary artifacts
name: Github Release
on:
workflow_call:
inputs:
node_tag:
description: "Node Release Tag"
required: true
type: string
node_docker_tag:
description: "Node Docker Release Tag"
required: true
type: string
signer_tag:
description: "Signer Release Tag"
required: true
type: string
signer_docker_tag:
description: "Signer Docker Release Tag"
required: true
type: string
is_node_release:
description: "True if it is a node release"
required: true
type: string
is_signer_release:
description: "True if it is a signer release"
required: true
type: string
secrets:
GH_TOKEN:
required: true
concurrency:
group: github-release-${{ github.head_ref || github.ref }}
## Always cancel duplicate jobs
cancel-in-progress: true
run-name: ${{ inputs.node_tag || inputs.signer_tag }}
jobs:
## Build arch dependent binaries from source
##
## Runs when the following is true:
## - either node or signer tag is provided
build-binaries:
if: |
inputs.node_tag != '' ||
inputs.signer_tag != ''
name: Build Binaries
runs-on: ubuntu-latest
strategy:
## Run a maximum of 10 builds concurrently, using the matrix defined in inputs.arch
max-parallel: 10
matrix:
arch:
- linux-musl
- linux-glibc
- macos
- windows
cpu:
- arm64
- armv7
- x86-64 ## defaults to x86-64-v3 variant - intel haswell (2013) and newer
# - x86-64-v2 ## intel nehalem (2008) and newer
# - x86-64-v3 ## intel haswell (2013) and newer
# - x86-64-v4 ## intel skylake (2017) and newer
exclude:
- arch: windows # excludes windows-arm64
cpu: arm64
- arch: windows # excludes windows-armv7
cpu: armv7
- arch: macos # excludes macos-armv7
cpu: armv7
steps:
- name: Build Binary (${{ matrix.arch }}_${{ matrix.cpu }})
uses: stacks-network/actions/stacks-core/release/create-source-binary@main
with:
arch: ${{ matrix.arch }}
cpu: ${{ matrix.cpu }}
node_tag: ${{ inputs.node_tag }}
signer_tag: ${{ inputs.signer_tag }}
signer_docker_tag: ${{ inputs.signer_docker_tag }}
is_node_release: ${{ inputs.is_node_release }}
## Runs when the following is true:
## - either node or signer tag is provided
create-release:
if: |
inputs.node_tag != '' ||
inputs.signer_tag != ''
name: Create Release
runs-on: ubuntu-latest
needs:
- build-binaries
steps:
## Creates releases
- name: Create Release
uses: stacks-network/actions/stacks-core/release/create-releases@main
with:
node_tag: ${{ inputs.node_tag }}
node_docker_tag: ${{ inputs.node_docker_tag }}
signer_tag: ${{ inputs.signer_tag }}
signer_docker_tag: ${{ inputs.signer_docker_tag }}
is_node_release: ${{ inputs.is_node_release }}
is_signer_release: ${{ inputs.is_signer_release }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
## Builds arch dependent Docker images from binaries
##
## Runs when the following is true:
## - either node or signer tag is provided
docker-image:
if: |
inputs.node_tag != '' ||
inputs.signer_tag != ''
name: Docker Image (Binary)
runs-on: ubuntu-latest
needs:
- build-binaries
- create-release
strategy:
fail-fast: false
## Build a maximum of 2 images concurrently based on matrix.dist
max-parallel: 2
matrix:
dist:
- alpine
- debian
steps:
- name: Create Docker Image
uses: stacks-network/actions/stacks-core/release/docker-images@main
with:
node_tag: ${{ inputs.node_tag }}
node_docker_tag: ${{ inputs.node_docker_tag }}
signer_tag: ${{ inputs.signer_tag }}
signer_docker_tag: ${{ inputs.signer_docker_tag }}
is_node_release: ${{ inputs.is_node_release }}
is_signer_release: ${{ inputs.is_signer_release }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
dist: ${{ matrix.dist }}