--- /dev/null
+name: Release
+
+on:
+ push:
+ branches:
+ - 'main'
+
+jobs:
+ buildtest:
+ name: test_ubuntu_go${{ matrix.go }}
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ go: [ '1.22' ]
+ steps:
+ - name: Set up Go${{ matrix.go }}
+ uses: actions/setup-go@v5
+ with:
+ go-version: ${{ matrix.go }}
+
+ - name: Check out code
+ uses: actions/checkout@v4
+ with:
+ lfs: true
+
+ - name: Checkout LFS objects
+ run: git lfs checkout
+
+
+ - name: golangci-lint
+ uses: golangci/golangci-lint-action@v4
+ with:
+ args: --timeout 5m --verbose
+
+ - name: Test
+ run: |
+ go get .
+ CGO_ENABLED=0 go test -v --cover -coverprofile=coverage ./...
+
+ - name: Codecov
+ uses: codecov/codecov-action@v4
+ with:
+ token: ${{secrets.CODECOV_TOKEN}}
+ file: coverage
+
+ u-build:
+ name: build_ubuntu_go${{ matrix.go }}
+ needs: [buildtest]
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ go: [ '1.22' ]
+ steps:
+ - name: Set up Go${{ matrix.go }}
+ uses: actions/setup-go@v5
+ with:
+ go-version: ${{ matrix.go }}
+
+ - name: Check out code
+ uses: actions/checkout@v4
+ with:
+ lfs: true
+
+ - name: Checkout LFS objects
+ run: git lfs checkout
+
+ - name: Build
+ run: |
+ go get .
+ CGO_ENABLED=0 go build -pgo=auto -v -buildmode=exe main.go
+
+ - name: zip
+ run: zip -q -r ubuntu_go${{ matrix.go }}.zip demo
+
+ - name: Upload a Release Asset
+ uses: softprops/action-gh-release@v2
+ with:
+ draft: true
+ files: |
+ ./ubuntu_go${{ matrix.go }}.zip
+
+ w-build:
+ name: build_windows_go${{ matrix.go }}
+ needs: [buildtest]
+ runs-on: windows-latest
+ strategy:
+ matrix:
+ go: [ '1.22' ]
+ steps:
+ - name: Set up Go${{ matrix.go }}
+ uses: actions/setup-go@v5
+ with:
+ go-version: ${{ matrix.go }}
+
+ - name: Check out code
+ uses: actions/checkout@v4
+ with:
+ lfs: true
+
+ - name: Checkout LFS objects
+ run: git lfs checkout
+
+
+ - name: Build
+ run: |
+ go get .
+ go build -pgo=auto -v -buildmode=exe main.go
+
+ - name: zip
+ run: .\7za.exe a -r .\windows_go${{ matrix.go }}.zip ./demo
+
+ - name: Upload a Release Asset
+ uses: softprops/action-gh-release@v2
+ with:
+ draft: true
+ files: |
+ ./windows_go${{ matrix.go }}.zip
+
+ m-build:
+ name: build_macos_go${{ matrix.go }}
+ needs: [buildtest]
+ runs-on: macos-latest
+ strategy:
+ matrix:
+ go: [ '1.22' ]
+ steps:
+ - name: Set up Go${{ matrix.go }}
+ uses: actions/setup-go@v5
+ with:
+ go-version: ${{ matrix.go }}
+
+ - name: Check out code
+ uses: actions/checkout@v4
+ with:
+ lfs: true
+
+ - name: Checkout LFS objects
+ run: git lfs checkout
+
+
+ - name: Build
+ run: |
+ go get .
+ go build -pgo=auto -v -buildmode=exe main.go
+
+ - name: zip
+ run: zip -q -r macos_go${{ matrix.go }}.zip demo
+
+ - name: Upload a Release Asset
+ uses: softprops/action-gh-release@v2
+ with:
+ draft: true
+ files: |
+ ./macos_go${{ matrix.go }}.zip