mirror of
https://github.com/nxtrace/NTrace-core.git
synced 2025-08-12 06:26:39 +00:00
49 lines
1.2 KiB
YAML
49 lines
1.2 KiB
YAML
on:
|
|
push:
|
|
pull_request:
|
|
|
|
name: Test & Build Release
|
|
jobs:
|
|
Test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-go@v2
|
|
with:
|
|
go-version: "1.18"
|
|
|
|
- name: Test
|
|
run: sudo go test -v -coverprofile='coverage.out' -covermode=count ./...
|
|
|
|
Build:
|
|
needs: test
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-go@v2
|
|
with:
|
|
go-version: "1.18"
|
|
|
|
- run: bash .cross_compile.sh
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v1
|
|
with: # 将下述可执行文件 release 上去
|
|
draft: false # Release草稿
|
|
files: |
|
|
dist/nexttrace_darwin_amd64
|
|
dist/nexttrace_darwin_arm64
|
|
dist/nexttrace_linux_386
|
|
dist/nexttrace_linux_amd64
|
|
dist/nexttrace_linux_arm64
|
|
dist/nexttrace_linux_armv7
|
|
dist/nexttrace_linux_mips
|
|
dist/nexttrace_openbsd_amd64
|
|
dist/nexttrace_openbsd_arm64
|
|
dist/nexttrace_freebsd_amd64
|
|
dist/nexttrace_freebsd_arm64
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GT_Token }} |