-
Notifications
You must be signed in to change notification settings - Fork 681
102 lines (93 loc) · 2.78 KB
/
github-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
## Github workflow to create a github release and upload binary artifacts
name: Github Release
on:
workflow_call:
inputs:
tag:
description: "Release Tag"
required: true
type: string
docker_tag:
description: "Docker Release Tag"
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.tag }}
jobs:
## Build arch dependent binaries from source
##
## Runs when the following is true:
## - tag is provided
build-binaries:
if: |
inputs.tag != ''
name: Build Binaries
uses: ./.github/workflows/create-source-binary.yml
with:
tag: ${{ inputs.tag }}
secrets: inherit
## Runs when the following is true:
## - tag is provided
## - workflow is building default branch (master)
create-release:
if: |
inputs.tag != ''
name: Create Release
runs-on: ubuntu-latest
needs:
- build-binaries
steps:
## Downloads the artifacts built in `create-source-binary.yml`
- name: Download Artifacts
id: download_artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
pattern: ${{ inputs.tag }}-binary-build-*
path: release
merge-multiple: true
## Generate a checksums file to be added to the release page
- name: Generate Checksums
id: generate_checksum
uses: stacks-network/actions/generate-checksum@main
with:
artifact_download_pattern: "${{ inputs.tag }}-binary-build-*"
## Upload the release archives with the checksums file
- name: Upload Release
id: upload_release
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 #v2.0.5
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
name: Release ${{ inputs.tag || github.ref }}
tag_name: ${{ inputs.tag || github.ref }}
draft: false
prerelease: true
fail_on_unmatched_files: true
target_commitish: ${{ github.sha }}
generate_release_notes: true
files: |
release/*.zip
CHECKSUMS.txt
## Builds arch dependent Docker images from binaries
##
## Runs when the following is true:
## - tag is provided
## - workflow is building default branch (master)
docker-image:
if: |
inputs.tag != ''
name: Docker Image (Binary)
uses: ./.github/workflows/image-build-binary.yml
needs:
- build-binaries
- create-release
with:
tag: ${{ inputs.tag }}
docker_tag: ${{ inputs.docker_tag }}
secrets: inherit