-
Notifications
You must be signed in to change notification settings - Fork 17
70 lines (66 loc) · 2.18 KB
/
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
name: release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.16
uses: actions/setup-go@v1
with:
go-version: 1.16
id: go
- name: Check out code
uses: actions/checkout@v1
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Build and pack for Linux
run: |
GOOS=linux GOARCH=amd64 make
cp .target/goslice goslice
tar -czf goslice-linux-amd64.tar.gz goslice
- name: Build and pack for Linux ARMv7
run: |
GOOS=linux GOARCH=arm GOARM=7 make
cp .target/goslice goslice
tar -czf goslice-linux-armv7.tar.gz goslice
- name: Build and pack for Linux ARM64
run: |
GOOS=linux GOARCH=arm64 make
cp .target/goslice goslice
tar -czf goslice-linux-arm64.tar.gz goslice
- name: Build and pack for macOS
run: |
GOOS=darwin GOARCH=amd64 make
cp .target/goslice goslice
tar -czf goslice-macos-amd64.tar.gz goslice
- name: Build and pack for macOS ARM64 (M1)
run: |
GOOS=darwin GOARCH=arm64 make
cp .target/goslice goslice
tar -czf goslice-macos-arm64.tar.gz goslice
- name: Build and pack for Windows
run: |
GOOS=windows GOARCH=amd64 make
cp .target/goslice.exe goslice.exe
zip goslice-windows-amd64.zip goslice.exe
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ steps.get_version.outputs.VERSION }}"
prerelease: false
title: "GoSlice ${{ steps.get_version.outputs.VERSION }}"
files: |
goslice-linux-amd64.tar.gz
goslice-linux-armv7.tar.gz
goslice-linux-arm64.tar.gz
goslice-macos-amd64.tar.gz
goslice-macos-arm64.tar.gz
goslice-windows-amd64.zip