diff --git a/.github/workflows/release_linux.yml b/.github/workflows/release_linux.yml new file mode 100644 index 0000000..9f67756 --- /dev/null +++ b/.github/workflows/release_linux.yml @@ -0,0 +1,38 @@ +name: Build and publish release binaries for Linux + +on: + push: + tags: + - "v*.*.*" + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.21" + + - uses: goto-bus-stop/setup-zig@v2 + with: + version: "0.11.0" + + - name: Test + run: go test -v ./... + + - name: Build x86_64 Linux + run: GOOS=linux GOARCH=amd64 CGO_ENABLED=1 CC="zig cc -target x86_64-linux-musl" go build -o timew-sync-server-x86_64-linux + + - name: Build aarch64 Linux + run: GOOS=linux GOARCH=arm64 CGO_ENABLED=1 CC="zig cc -target aarch64-linux-musl" go build -o timew-sync-server-aarch64-linux + + - name: Release + uses: softprops/action-gh-release@v0.1.15 + with: + files: | + timew-sync-server-x86_64-linux + timew-sync-server-aarch64-linux diff --git a/.github/workflows/release_mac.yml b/.github/workflows/release_mac.yml new file mode 100644 index 0000000..038e43b --- /dev/null +++ b/.github/workflows/release_mac.yml @@ -0,0 +1,34 @@ +name: Build and publish release binaries for macOS + +on: + push: + tags: + - "v*.*.*" + +jobs: + build: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.21" + + - name: Test + run: go test -v ./... + + - name: Build x86_64 macOS + run: GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 go build -o timew-sync-server-x86_64-macos + + - name: Build aarch64 macOS + run: GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 go build -o timew-sync-server-aarch64-macos + + - name: Release + uses: softprops/action-gh-release@v0.1.15 + with: + files: | + timew-sync-server-x86_64-macos + timew-sync-server-aarch64-macos