Skip to content

fix some error

fix some error #18

Workflow file for this run

# 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
permissions:
contents: write
on:
push:
tags:
- "v*"
env:
AUTH_TOKEN: ${{secrets.AUTH_TOKEN}}
CT0: ${{secrets.CT0}}
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Build
run: |
if [${{runner.os}} == 'Windows']; then
go build -v -o tmd2.exe -ldflags "-linkmode external -extldflags -static" .
else
go build -v -o tmd2 .
fi
- name: Test
run: go test ./...
- name: Package
run: |
if [ ${{ runner.os }} == 'Windows' ]; then
Compress-Archive -Path tmd2.exe -DestinationPath tmd2-${{runner.os}}.zip
else
tar -czvf tmd2-${{runner.os}}.tar.gz tmd2
fi
- name: Release Win
if: runner.os == 'Windows'
uses: softprops/action-gh-release@v2
with:
files: tmd2-${{runner.os}}.zip
- name: Release Posix
if: runner.os != 'Windows'
uses: softprops/action-gh-release@v2
with:
files: tmd2-${{ runner.os }}.tar.gz