-
Notifications
You must be signed in to change notification settings - Fork 38
61 lines (53 loc) · 1.73 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
58
59
60
61
name: Release
on:
release:
types: [published]
jobs:
release:
name: Release polaris
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux]
goarch: [amd64]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.21"
- name: Build
id: build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
VERSION: ${{ steps.get_version.outputs.VERSION }}
run: |
echo "version is $VERSION"
bash build.sh $VERSION
PACKAGE_NAME=$(ls polaris-controller-release*.zip | sed -n '1p')
echo ::set-output name=name::${PACKAGE_NAME}
PACKAGE_NAME=$(ls polaris-controller-release*.zip | sed -n '2p')
echo ::set-output name=name1::${PACKAGE_NAME}
- name: Upload asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.build.outputs.name }}
asset_name: ${{ steps.build.outputs.name }}
asset_content_type: application/gzip
- name: Upload asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.build.outputs.name1 }}
asset_name: ${{ steps.build.outputs.name1 }}
asset_content_type: application/gzip