-
Notifications
You must be signed in to change notification settings - Fork 3
44 lines (38 loc) · 1.01 KB
/
update_release_assets.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
name: Build and update release assets
on:
push:
tags:
- v*
workflow_dispatch:
inputs:
version:
required: true
description: 'version to update release assets'
default: 'v'
jobs:
assets:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.17
uses: actions/setup-go@v1
with:
go-version: 1.17
id: go
- name: Check out code
uses: actions/checkout@v1
- name: Get tag version
id: tag
run: |
TAG=${{ github.event.inputs.command }}
test -z "$TAG" && TAG=$(git tag --sort=-v:refname --points-at HEAD | head -n 1)
echo "TAG=$TAG" >> $GITHUB_ENV
- name: Cross compile
run: make build-all
- name: Upload assets to the release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export GOPATH=$(go env GOPATH)
go get -u github.com/tcnksm/ghr
echo "Upload version [${{ env.TAG }}]"
${GOPATH}/bin/ghr -replace ${{ env.TAG }} bin/release