Merge pull request #233 from luotianqi777/fix_tar #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}' " |