Skip to content

Commit b6b73d2

Browse files
authored
Add checksum step for release workflow (#102)
Signed-off-by: thepetk <thepetk@gmail.com>
1 parent 56d6cd8 commit b6b73d2

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

.github/workflows/release.yaml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
on:
22
push:
33
tags:
4-
- 'v*'
4+
- "v*"
55

66
name: Build Release
77

@@ -15,25 +15,25 @@ permissions:
1515
jobs:
1616
release:
1717
name: Create Release
18-
runs-on: 'ubuntu-latest'
18+
runs-on: "ubuntu-latest"
1919
strategy:
2020
matrix:
2121
goosarch:
22-
- 'darwin/amd64'
23-
- 'darwin/arm64'
24-
- 'linux/amd64'
25-
- 'linux/arm64'
26-
- 'linux/ppc64le'
27-
- 'linux/s390x'
28-
- 'windows/amd64'
22+
- "darwin/amd64"
23+
- "darwin/arm64"
24+
- "linux/amd64"
25+
- "linux/arm64"
26+
- "linux/ppc64le"
27+
- "linux/s390x"
28+
- "windows/amd64"
2929
steps:
3030
- name: Checkout code
3131
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
3232
with:
3333
fetch-depth: 0
3434
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
3535
with:
36-
go-version-file: 'go.mod'
36+
go-version-file: "go.mod"
3737
- name: Get OS and arch info
3838
run: |
3939
GOOSARCH=${{matrix.goosarch}}
@@ -47,15 +47,24 @@ jobs:
4747
BINARY_NAME=alizer-$RELEASE_VERSION-$GOOS-$GOARCH
4848
fi
4949
echo "BINARY_NAME=$BINARY_NAME" >> $GITHUB_ENV
50+
echo "HASHFILE_NAME=$BINARY_NAME.sha256" >> $GITHUB_ENV
5051
echo "GOOS=$GOOS" >> $GITHUB_ENV
5152
echo "GOARCH=$GOARCH" >> $GITHUB_ENV
5253
- name: Build
5354
run: |
54-
go build -o "$BINARY_NAME" -v
55+
go build -o ${{env.BINARY_NAME}} -v
56+
- name: Generate sha256 checksum
57+
uses: jmgilman/actions-generate-checksum@3ea6dc9bf8eecf28e2ecc982fab683484a1a8561 # v1.0.1
58+
with:
59+
output: ${{env.HASHFILE_NAME}}
60+
method: sha256
61+
patterns: ${{env.BINARY_NAME}}
5562
- name: Release with Notes and Binaries
5663
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
5764
with:
5865
draft: false
59-
files: ${{env.BINARY_NAME}}
66+
files: |
67+
${{env.BINARY_NAME}}
68+
${{env.HASHFILE_NAME}}
6069
env:
6170
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)