-
Notifications
You must be signed in to change notification settings - Fork 16
80 lines (67 loc) · 1.74 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
71
72
73
74
75
76
77
78
79
80
name: Release
on:
push:
tags:
- "v*.*.*"
jobs:
build:
runs-on: ubuntu-latest
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
strategy:
matrix:
os:
- linux
- darwin
- windows
arch:
- amd64
- arm64
steps:
- name: Version
id: version
run: echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//}
- name: Checkout
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17.1
- name: Cache Go
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download Dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: go mod download
- name: Build Artifacts
run: |
out=kubectl-curl_${{ steps.version.outputs.tag }}_${{ env.GOOS }}_${{ env.GOARCH }}
CGO_ENABLED=0 go build -o $out
tar czf $out.tar.gz $out LICENSE
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: kubectl-curl_${{ steps.version.outputs.tag }}_${{ env.GOOS }}_${{ env.GOARCH }}
path: kubectl-curl_${{ steps.version.outputs.tag }}_${{ env.GOOS }}_${{ env.GOARCH }}.tar.gz
release:
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: .
- name: Release Artifacts
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: |
kubectl-curl_*/*
LICENSE