-
Notifications
You must be signed in to change notification settings - Fork 62
87 lines (71 loc) · 2.71 KB
/
build_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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Build and Release
on:
push:
tags:
- '*'
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21.1
- name: Installation depends
run: |
make require
- name: Project Tag Version
id: get_tag
run: echo "::set-output name=tag::$(echo $GITHUB_REF | cut -d '/' -f 3)"
shell: bash
- name: Build
run: |
tag_version="${{ steps.get_tag.outputs.tag }}"
echo "Building version $tag_version"
make release version=$tag_version
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: |
tag_version="${{ steps.get_tag.outputs.tag }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: upload linux zip artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/haotrader.${{ steps.get_tag.outputs.tag }}.linux-amd64.zip
asset_name: haotrader.${{ steps.get_tag.outputs.tag }}.linux-amd64.zip
asset_content_type: application/zip
- name: upload linux tar.gz artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/haotrader.${{ steps.get_tag.outputs.tag }}.linux-amd64.tar.gz
asset_name: haotrader.${{ steps.get_tag.outputs.tag }}.linux-amd64.tar.gz
asset_content_type: application/octet-stream
- name: upload darwin zip artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/haotrader.${{ steps.get_tag.outputs.tag }}.darwin-amd64.zip
asset_name: haotrader.${{ steps.get_tag.outputs.tag }}.darwin-amd64.zip
asset_content_type: application/zip
- name: upload darwin tar.gz artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/haotrader.${{ steps.get_tag.outputs.tag }}.darwin-amd64.tar.gz
asset_name: haotrader.${{ steps.get_tag.outputs.tag }}.darwin-amd64.tar.gz
asset_content_type: application/octet-stream