diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index a4b785c..f908ab8 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,17 +1,35 @@ -on: [push, pull_request] -name: Build +# .github/workflows/release.yaml + +on: + push: + release: + types: [created] + +permissions: + contents: write + packages: write + jobs: - test-nocache: + releases-matrix: + name: Release Cobalt Binary + runs-on: ubuntu-latest strategy: matrix: - go-version: [ 1.21.x ] - os: [ubuntu-latest, macos-latest, windows-latest] - runs-on: ${{ matrix.os }} + goos: [linux, windows, darwin] + goarch: ["386", amd64, arm64] + exclude: + - goarch: "386" + goos: darwin + - goarch: arm64 + goos: windows steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: wangyoucao577/go-release-action@v1 with: - go-version: ${{ matrix.go-version }} - cache: false - - run: go build -o "${{ matrix.os }}" ./... - + github_token: ${{ secrets.GITHUB_TOKEN }} + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + binary_name: "cobalt-${{ matrix.goos }}-${{ matrix.goarch }}" + ldflags: -s -w + pre_command: "go install github.com/tc-hib/go-winres@latest && go-winres make" + asset_name: "cobalt-${{ matrix.goos }}-${{ matrix.goarch }}"