Merge pull request #2 from xzclinux/master #37
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
# This workflow will build a golang project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
name: Go create executable file | |
on: | |
push: | |
tags: | |
- 'v*' | |
env: | |
BINARY_PREFIX: "sql-zh-exporter_" | |
BINARY_SUFFIX: "" | |
COMMIT_ID: "${{ github.sha }}" | |
PR_PROMPT: "::warning:: Build artifact will not be uploaded due to the workflow is trigged by pull request." | |
jobs: | |
# build: | |
# name: Build binary CI | |
# runs-on: ubuntu-latest | |
# strategy: | |
# matrix: | |
# # build and publish in parallel: linux/386, linux/amd64, windows/386, windows/amd64, darwin/amd64, darwin/arm64 | |
# goos: [ linux, windows, darwin ] | |
# goarch: [ "386", amd64, arm, arm64 ] | |
# exclude: | |
# - goos: darwin | |
# goarch: arm | |
# - goos: darwin | |
# goarch: "386" | |
# fail-fast: true | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - name: Setup Go environment | |
# uses: actions/setup-go@v3 | |
# with: | |
# cache: true | |
# go-version: '1.19' | |
# - name: Build binary file | |
# env: | |
# GOOS: ${{ matrix.goos }} | |
# GOARCH: ${{ matrix.goarch }} | |
# IS_PR: ${{ !!github.head_ref }} | |
# run: | | |
# if [ $GOOS = "windows" ]; then export BINARY_SUFFIX="$BINARY_SUFFIX.exe"; fi | |
# if $IS_PR ; then echo $PR_PROMPT; fi | |
# export BINARY_NAME="$BINARY_PREFIX"$GOOS"_$GOARCH$BINARY_SUFFIX" | |
# export CGO_ENABLED=0 | |
# go build -o "dist/$BINARY_NAME" . | |
# cp config.yml dist/ | |
# cp job_config.yml dist/ | |
# - name: Upload artifact | |
# uses: actions/upload-artifact@v3 | |
# if: ${{ !github.head_ref }} | |
# with: | |
# name: ${{ matrix.goos }}_${{ matrix.goarch }} | |
# path: dist/ | |
goreleaser: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v4 | |
with: | |
version: latest | |
args: | | |
release --clean --config .goreleaser.yaml | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload assets | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sql_zh_exporter | |
path: | | |
config.yml | |
job_config.yml | |
kingbase_job_config.yml | |
dm_job_config.yml |