This repository has been archived by the owner on Aug 19, 2022. It is now read-only.
forked from sergiorua/kube-tagger
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (54 loc) · 2.05 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
on:
push:
tags:
- 'v*'
name: Handle Release
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: 1.13.x
- name: Checkout code
uses: actions/checkout@v2
- name: Get tag version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Build Asset (linux)
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-X 'main.Version=${{ steps.get_version.outputs.VERSION }}'" -o bin/kube-tagger-linux-amd64 ./cmd/kube-tagger/...
- name: Build Asset (darwin)
run: CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="-X 'main.Version=${{ steps.get_version.outputs.VERSION }}'" -o bin/kube-tagger-darwin-amd64 ./cmd/kube-tagger/...
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
body: |
Build also available as docker image:
`gdisdevops/kube-tagger:v${{ steps.get_version.outputs.VERSION }}`
- name: Upload Release Asset (linux)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/kube-tagger-linux-amd64
asset_name: kube-tagger-linux-amd64
asset_content_type: application/x-executable
- name: Upload Release Asset (darwin)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/kube-tagger-darwin-amd64
asset_name: kube-tagger-darwin-amd64
asset_content_type: application/x-mach-binary