forked from redhat-developer/alizer
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (50 loc) · 1.2 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
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'
- 'linux/amd64'
- 'linux/ppc64le'
- 'linux/s390x'
- 'windows/amd64'
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: '1.19.5'
- name: Get OS and arch info
run: |
GOOSARCH=${{matrix.goosarch}}
GOOS=${GOOSARCH%/*}
GOARCH=${GOOSARCH#*/}
BINARY_NAME=alizer-$GOOS-$GOARCH
echo "BINARY_NAME=$BINARY_NAME" >> $GITHUB_ENV
echo "GOOS=$GOOS" >> $GITHUB_ENV
echo "GOARCH=$GOARCH" >> $GITHUB_ENV
- name: Build
run: |
cd go/
go build -o "$BINARY_NAME" -v
- name: Release with Notes and Binaries
uses: softprops/action-gh-release@v1
with:
draft: false
files: go/${{env.BINARY_NAME}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}