-
Notifications
You must be signed in to change notification settings - Fork 25
58 lines (58 loc) · 2.19 KB
/
tag.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
---
name: "Release a tag"
on:
release:
types: [created]
jobs:
release-darwin-amd64:
name: release darwin/amd64
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '^1.15.0'
- run: go build
- run: echo ::set-output name=RELEASE_VERSION::${GITHUB_REF#refs/*/}
id: get_tag_name
- run: tar -czf "sqlvet-${{ steps.get_tag_name.outputs.RELEASE_VERSION }}-darwin-amd64.tar.gz" "sqlvet";
- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./sqlvet-${{ steps.get_tag_name.outputs.RELEASE_VERSION }}-darwin-amd64.tar.gz
asset_name: sqlvet-${{ steps.get_tag_name.outputs.RELEASE_VERSION }}-darwin-amd64.tar.gz
asset_content_type: application/octet-stream
release-linux-amd64:
name: release linux/amd64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '^1.15.0'
- run: go build -ldflags '-w -extldflags "-static"'
- run: echo ::set-output name=RELEASE_VERSION::${GITHUB_REF#refs/*/}
id: get_tag_name
- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: tar -czf "sqlvet-${{ steps.get_tag_name.outputs.RELEASE_VERSION }}-linux-amd64.tar.gz" "sqlvet";
- name: Upload binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./sqlvet-${{ steps.get_tag_name.outputs.RELEASE_VERSION }}-linux-amd64.tar.gz
asset_name: sqlvet-${{ steps.get_tag_name.outputs.RELEASE_VERSION }}-linux-amd64.tar.gz
asset_content_type: application/octet-stream