-
Notifications
You must be signed in to change notification settings - Fork 14
70 lines (66 loc) · 1.96 KB
/
release.yaml
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
on:
push:
tags:
- "v*"
name: Build Release
defaults:
run:
shell: bash
permissions:
contents: write
jobs:
release:
name: Create Release
runs-on: "ubuntu-latest"
strategy:
matrix:
goosarch:
- "darwin/amd64"
- "darwin/arm64"
- "linux/amd64"
- "linux/arm64"
- "linux/ppc64le"
- "linux/s390x"
- "windows/amd64"
steps:
- name: Checkout code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
fetch-depth: 0
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: "go.mod"
- name: Get OS and arch info
run: |
GOOSARCH=${{matrix.goosarch}}
GOOS=${GOOSARCH%/*}
GOARCH=${GOOSARCH#*/}
RELEASE_VERSION=${GITHUB_REF#refs/*/}
if [ "$GOOS" == "windows" ]
then
BINARY_NAME=alizer-$RELEASE_VERSION-$GOOS-$GOARCH.exe
else
BINARY_NAME=alizer-$RELEASE_VERSION-$GOOS-$GOARCH
fi
echo "BINARY_NAME=$BINARY_NAME" >> $GITHUB_ENV
echo "HASHFILE_NAME=$BINARY_NAME.sha256" >> $GITHUB_ENV
echo "GOOS=$GOOS" >> $GITHUB_ENV
echo "GOARCH=$GOARCH" >> $GITHUB_ENV
- name: Build
run: |
go build -o ${{env.BINARY_NAME}} -v
- name: Generate sha256 checksum
uses: jmgilman/actions-generate-checksum@3ea6dc9bf8eecf28e2ecc982fab683484a1a8561 # v1.0.1
with:
output: ${{env.HASHFILE_NAME}}
method: sha256
patterns: ${{env.BINARY_NAME}}
- name: Release with Notes and Binaries
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
with:
draft: false
files: |
${{env.BINARY_NAME}}
${{env.HASHFILE_NAME}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}