@@ -5,12 +5,28 @@ name: Github Release
5
5
on :
6
6
workflow_call :
7
7
inputs :
8
- tag :
9
- description : " Release Tag"
8
+ node_tag :
9
+ description : " Node Release Tag"
10
10
required : true
11
11
type : string
12
- docker_tag :
13
- description : " Docker Release Tag"
12
+ node_docker_tag :
13
+ description : " Node Docker Release Tag"
14
+ required : true
15
+ type : string
16
+ signer_tag :
17
+ description : " Signer Release Tag"
18
+ required : true
19
+ type : string
20
+ signer_docker_tag :
21
+ description : " Signer Docker Release Tag"
22
+ required : true
23
+ type : string
24
+ is_node_release :
25
+ description : " True if it is a node release"
26
+ required : true
27
+ type : string
28
+ is_signer_release :
29
+ description : " True if it is a signer release"
14
30
required : true
15
31
type : string
16
32
secrets :
@@ -22,81 +38,107 @@ concurrency:
22
38
# # Always cancel duplicate jobs
23
39
cancel-in-progress : true
24
40
25
- run-name : ${{ inputs.tag }}
41
+ run-name : ${{ inputs.node_tag || inputs.signer_tag }}
26
42
27
43
jobs :
28
44
# # Build arch dependent binaries from source
29
45
# #
30
46
# # Runs when the following is true:
31
- # # - tag is provided
47
+ # # - either node or signer tag is provided
32
48
build-binaries :
33
49
if : |
34
- inputs.tag != ''
50
+ inputs.node_tag != '' ||
51
+ inputs.signer_tag != ''
35
52
name : Build Binaries
36
- uses : ./.github/workflows/create-source-binary.yml
37
- with :
38
- tag : ${{ inputs.tag }}
39
- secrets : inherit
53
+ runs-on : ubuntu-latest
54
+ strategy :
55
+ # # Run a maximum of 10 builds concurrently, using the matrix defined in inputs.arch
56
+ max-parallel : 10
57
+ matrix :
58
+ arch :
59
+ - linux-musl
60
+ - linux-glibc
61
+ - macos
62
+ - windows
63
+ cpu :
64
+ - arm64
65
+ - armv7
66
+ - x86-64 # # defaults to x86-64-v3 variant - intel haswell (2013) and newer
67
+ # - x86-64-v2 ## intel nehalem (2008) and newer
68
+ # - x86-64-v3 ## intel haswell (2013) and newer
69
+ # - x86-64-v4 ## intel skylake (2017) and newer
70
+ exclude :
71
+ - arch : windows # excludes windows-arm64
72
+ cpu : arm64
73
+ - arch : windows # excludes windows-armv7
74
+ cpu : armv7
75
+ - arch : macos # excludes macos-armv7
76
+ cpu : armv7
77
+ steps :
78
+ - name : Build Binary (${{ matrix.arch }}_${{ matrix.cpu }})
79
+ uses : stacks-network/actions/stacks-core/release/create-source-binary@main
80
+ with :
81
+ arch : ${{ matrix.arch }}
82
+ cpu : ${{ matrix.cpu }}
83
+ node_tag : ${{ inputs.node_tag }}
84
+ signer_tag : ${{ inputs.signer_tag }}
85
+ signer_docker_tag : ${{ inputs.signer_docker_tag }}
86
+ is_node_release : ${{ inputs.is_node_release }}
40
87
41
88
# # Runs when the following is true:
42
- # # - tag is provided
43
- # # - workflow is building default branch (master)
89
+ # # - either node or signer tag is provided
44
90
create-release :
45
91
if : |
46
- inputs.tag != ''
92
+ inputs.node_tag != '' ||
93
+ inputs.signer_tag != ''
47
94
name : Create Release
48
95
runs-on : ubuntu-latest
49
96
needs :
50
97
- build-binaries
51
98
steps :
52
- # # Downloads the artifacts built in `create-source-binary.yml`
53
- - name : Download Artifacts
54
- id : download_artifacts
55
- uses : actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
56
- with :
57
- pattern : ${{ inputs.tag }}-binary-build-*
58
- path : release
59
- merge-multiple : true
60
-
61
- # # Generate a checksums file to be added to the release page
62
- - name : Generate Checksums
63
- id : generate_checksum
64
- uses : stacks-network/actions/generate-checksum@main
99
+ # # Creates releases
100
+ - name : Create Release
101
+ uses : stacks-network/actions/stacks-core/release/create-github-releases@main
65
102
with :
66
- artifact_download_pattern : " ${{ inputs.tag }}-binary-build-*"
67
-
68
- # # Upload the release archives with the checksums file
69
- - name : Upload Release
70
- id : upload_release
71
- uses : softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 # v2.0.5
72
- env :
73
- GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
74
- with :
75
- name : Release ${{ inputs.tag || github.ref }}
76
- tag_name : ${{ inputs.tag || github.ref }}
77
- draft : false
78
- prerelease : true
79
- fail_on_unmatched_files : true
80
- target_commitish : ${{ github.sha }}
81
- generate_release_notes : true
82
- files : |
83
- release/*.zip
84
- CHECKSUMS.txt
103
+ node_tag : ${{ inputs.node_tag }}
104
+ node_docker_tag : ${{ inputs.node_docker_tag }}
105
+ signer_tag : ${{ inputs.signer_tag }}
106
+ signer_docker_tag : ${{ inputs.signer_docker_tag }}
107
+ is_node_release : ${{ inputs.is_node_release }}
108
+ is_signer_release : ${{ inputs.is_signer_release }}
109
+ GH_TOKEN : ${{ secrets.GH_TOKEN }}
85
110
86
111
# # Builds arch dependent Docker images from binaries
87
112
# #
88
113
# # Runs when the following is true:
89
- # # - tag is provided
90
- # # - workflow is building default branch (master)
114
+ # # - either node or signer tag is provided
91
115
docker-image :
92
116
if : |
93
- inputs.tag != ''
117
+ inputs.node_tag != '' ||
118
+ inputs.signer_tag != ''
94
119
name : Docker Image (Binary)
95
- uses : ./.github/workflows/image-build-binary.yml
120
+ runs-on : ' ubuntu-latest '
96
121
needs :
97
122
- build-binaries
98
123
- create-release
99
- with :
100
- tag : ${{ inputs.tag }}
101
- docker_tag : ${{ inputs.docker_tag }}
102
- secrets : inherit
124
+ strategy :
125
+ fail-fast : false
126
+ # # Build a maximum of 2 images concurrently based on matrix.dist
127
+ max-parallel : 2
128
+ matrix :
129
+ dist :
130
+ - alpine
131
+ - debian
132
+ steps :
133
+ - name : Create Docker Image
134
+ uses : stacks-network/actions/stacks-core/release/create-docker-images@main
135
+ with :
136
+ node_tag : ${{ inputs.node_tag }}
137
+ node_docker_tag : ${{ inputs.node_docker_tag }}
138
+ signer_tag : ${{ inputs.signer_tag }}
139
+ signer_docker_tag : ${{ inputs.signer_docker_tag }}
140
+ is_node_release : ${{ inputs.is_node_release }}
141
+ is_signer_release : ${{ inputs.is_signer_release }}
142
+ DOCKERHUB_USERNAME : ${{ secrets.DOCKERHUB_USERNAME }}
143
+ DOCKERHUB_PASSWORD : ${{ secrets.DOCKERHUB_PASSWORD }}
144
+ dist : ${{ matrix.dist }}
0 commit comments