v0.2.1 #9
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: Release Go Binaries | |
on: | |
release: | |
types: [created] | |
workflow_dispatch: | |
env: | |
CMD_PATH: ./cmd/deployer | |
jobs: | |
releases-matrix: | |
name: Release Matrix | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
goos: [linux, windows, darwin] | |
goarch: ["386", amd64, arm64] | |
exclude: | |
# darwin/386, windows arm64 and linux/arm64 seems useless | |
- goarch: arm64 | |
goos: windows | |
- goarch: arm64 | |
goos: linux | |
- goarch: "386" | |
goos: darwin | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set APP_VERSION env | |
run: echo APP_VERSION=$(echo ${GITHUB_REF} | rev | cut -d'/' -f 1 | rev ) >> ${GITHUB_ENV} | |
- name: Set BUILD_TIME env | |
run: echo BUILD_TIME=$(date) >> ${GITHUB_ENV} | |
- name: Environment Printer | |
uses: managedkaos/[email protected] | |
- uses: wangyoucao577/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
goos: ${{ matrix.goos }} | |
goarch: ${{ matrix.goarch }} | |
project_path: "${{ env.CMD_PATH }}" | |
build_flags: -v | |
ldflags: -X "main.version=${{ env.APP_VERSION }}{{ env.BUILD_TIME }}" |