diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 093fccf..71533a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,11 +65,22 @@ jobs: CGO_ENABLED: 0 strategy: matrix: - goos: [linux, darwin] + goos: [linux, darwin, windows] goarch: ["386", amd64, arm64] + ext: ["", ".exe"] exclude: - goarch: "386" goos: darwin + - goarch: "386" + goos: windows + - goarch: arm64 + goos: windows + - goos: linux + ext: .exe + - goos: darwin + ext: .exe + - goos: windows + ext: "" steps: - uses: actions/checkout@v4 with: @@ -91,13 +102,13 @@ jobs: - id: vars run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - run: mkdir -p ${{ matrix.goos }}/${{ matrix.goarch }} - - run: env GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -ldflags="-X 'github.com/bart6114/cheek/pkg.version=${{ needs.version_tag.outputs.new_tag }}' -X 'github.com/bart6114/cheek/pkg.commitSHA=${{ steps.vars.outputs.sha_short }}'" -o ${{ matrix.goos }}/${{ matrix.goarch }} - - run: cp ${{ matrix.goos }}/${{ matrix.goarch }}/cheek ${{ matrix.goos }}/${{ matrix.goarch }}/cheek-${{ matrix.goos }}-${{ matrix.goarch }} + - run: env GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -ldflags="-X 'github.com/bart6114/cheek/pkg.version=${{ needs.version_tag.outputs.new_tag }}' -X 'github.com/bart6114/cheek/pkg.commitSHA=${{ steps.vars.outputs.sha_short }}'" -o ${{ matrix.goos }}/${{ matrix.goarch }}/cheek${{ matrix.ext }} + - run: cp ${{ matrix.goos }}/${{ matrix.goarch }}/cheek${{ matrix.ext }} ${{ matrix.goos }}/${{ matrix.goarch }}/cheek-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.ext }} ## upload artifacts for release - uses: actions/upload-artifact@v4 with: - name: cheek-${{ matrix.goos }}-${{ matrix.goarch }} - path: ${{ matrix.goos }}/${{ matrix.goarch }}/cheek-${{ matrix.goos }}-${{ matrix.goarch }} + name: cheek-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.ext }} + path: ${{ matrix.goos }}/${{ matrix.goarch }}/cheek-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.ext }} release: if: github.ref == 'refs/heads/main' && needs.version_tag.outputs.new_tag != ''