-
Notifications
You must be signed in to change notification settings - Fork 116
65 lines (62 loc) · 1.75 KB
/
build_and_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: Build Binaries And Release
on:
push:
tags:
- v*.*.*
workflow_dispatch:
inputs:
tag:
description: 'Tag to build'
required: true
log_level:
description: 'Log level'
required: false
default: 'info'
jobs:
createRelease:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Build Changelog
id: changelog
uses: mikepenz/release-changelog-builder-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: softprops/action-gh-release@v1
with:
body: ${{ steps.changelog.outputs.changelog }}
releases-matrix:
name: Release Binary
runs-on: ubuntu-latest
needs: [createRelease]
strategy:
matrix:
goos: [linux, windows, darwin]
goarch: [amd64, arm64, 386]
exclude:
- goarch: arm64
goos: windows
- goarch: 386
goos: darwin
- goarch: 386
goos: windows
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Create VERSION file
run: echo ${{ env.RELEASE_VERSION }} > VERSION
- name: Build And Release
uses: wangyoucao577/go-release-action@v1.39
env:
CGO_ENABLED: 0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
project_path: "./"
binary_name: opensca-cli
extra_files: README.md config.json db-demo.json VERSION
ldflags: "-s -w -X 'main.version=${{ env.RELEASE_VERSION }}' "