diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..7f1ab37 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,31 @@ +name: CI + +on: + workflow_dispatch: + +jobs: + test: + strategy: + matrix: + go: [ '1.22.x' ] + os: [ ubuntu-latest ] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go }} + - name: Test + run: go test ./... -coverprofile=coverage.txt + - name: Create Tag + if: success() # 仅在测试成功时运行 + run: | + git config --global user.name 'github-actions' + git config --global user.email 'github-actions@github.com' + TAG="v0.0.3-$(date +'%Y%m%d%H%M%S')" + git tag $TAG + git push origin $TAG + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/bk/version.go b/bk/version.go index df130cd..e49a52d 100644 --- a/bk/version.go +++ b/bk/version.go @@ -1,4 +1,4 @@ package backtrace -const BackTraceVersion = "0.0.2" +const BackTraceVersion = "v0.0.3" // git tag v0.0.3 var EnableLoger bool \ No newline at end of file