-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (57 loc) · 1.99 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
62
63
64
65
name: Create Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: actions/setup-go@v3
with:
go-version: ^1.17
- name: Build
run: |
GOOS=linux GOARCH=amd64 go build -o build/soar_linux soar.go
GOOS=windows GOARCH=amd64 go build -o build/soar_win32.exe soar.go
- name: Compress
run: |
upx build/soar_linux && chmod +x build/soar_linux
upx build/soar_win32.exe && chmod +x build/soar_win32.exe
- name: Changelog
id: get_changelog
run: |
sed -n "/^## \[${${{ github.ref_name }}:1}\]/,/^## /{/^## /b;p}" CHANGELOG.md > ./RELEASE
echo ::set-output name=version_name::`sed -nr "s/^## (\[${${{ github.ref_name }}:1}\] .*)$/\1/p" CHANGELOG.md`
- name: Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ steps.get_changelog.outputs.version_name }}
body_path: ./RELEASE
draft: true
prerelease: false
- name: Upload Linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_name: soar_linux
asset_path: build/soar_linux
asset_content_type: application/octet-stream
upload_url: ${{ steps.create_release.outputs.upload_url }}
- name: Upload Windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_name: soar_win32
asset_path: build/soar_win32.exe
asset_content_type: application/octet-stream
upload_url: ${{ steps.create_release.outputs.upload_url }}