Skip to content

Commit acd411d

Browse files
committed
perf: add github action
1 parent 3a9e77d commit acd411d

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Build And Release
4+
5+
# Controls when the action will run. Triggers the workflow on push or pull request
6+
# events but only for the master branch
7+
on:
8+
push:
9+
tags:
10+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
11+
12+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
13+
jobs:
14+
# This workflow contains a single job called "build"
15+
create_release:
16+
name: Create Release
17+
runs-on: ubuntu-latest
18+
outputs:
19+
upload_url: ${{ steps.create_release.outputs.upload_url }}
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v2
23+
- name: Get version
24+
id: get_version
25+
run: |
26+
TAG=$(basename ${GITHUB_REF})
27+
VERSION=${TAG/v/}
28+
echo "::set-output name=TAG::$TAG"
29+
echo "::set-output name=VERSION::$VERSION"
30+
- name: Create Release
31+
id: create_release
32+
uses: actions/create-release@v1
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
with:
36+
tag_name: ${{ github.ref }}
37+
release_name: ${{ github.ref }}
38+
draft: true
39+
prerelease: false
40+
- uses: actions/setup-go@v2
41+
with:
42+
go-version: '1.17.x' # The Go version to download (if necessary) and use.
43+
- name: Make Build
44+
id: make_build
45+
env:
46+
VERSION: ${{ steps.get_version.outputs.TAG }}
47+
run: |
48+
make && ls build
49+
- name: Release Upload Assets
50+
uses: softprops/action-gh-release@v1
51+
if: startsWith(github.ref, 'refs/tags/')
52+
with:
53+
draft: true
54+
files: |
55+
build/*.gz
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)