-
Notifications
You must be signed in to change notification settings - Fork 4
48 lines (41 loc) · 1.52 KB
/
go.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
name: "go"
on:
release:
types: [published]
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v2
- name: Get the version
id: get_version
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
else
echo "VERSION=${GITHUB_SHA}" >> $GITHUB_OUTPUT
fi
- name: "Build Go binaries"
uses: cloudposse/actions/go/build@0.28.0
env:
GO111MODULE: on
# Architectures to build for
GOX_OSARCH: >-
windows/386 windows/amd64 freebsd/arm netbsd/386 netbsd/amd64 netbsd/arm linux/s390x linux/arm darwin/amd64
linux/386 linux/amd64 freebsd/amd64 freebsd/386 openbsd/386 openbsd/amd64
OUTPUT_PATH: ${{ github.workspace }}/release/turf_
LDFLAGS: "-X 'github.com/cloudposse/turf/cmd.Version=${{ steps.get_version.outputs.VERSION }}'"
- name: "Upload artifacts to GitHub"
uses: actions/upload-artifact@v2
with:
name: ${{ github.event.repository.name }}
path: ${{ github.workspace }}/release/*
- name: "Attach artifacts to GitHub Release"
if: ${{ github.event_name == 'release' }}
uses: cloudposse/actions/github/release-assets@0.28.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INPUT_PATH: ${{ github.workspace }}/release/turf_*