Skip to content

Commit

Permalink
CI: Add workflows for building and publishing release binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimschmidt557 committed Jan 18, 2024
1 parent df1c1a3 commit 60ac206
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/release_linux.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
files: |
timew-sync-server-x86_64-linux
timew-sync-server-aarch64-linux
34 changes: 34 additions & 0 deletions .github/workflows/release_mac.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
files: |
timew-sync-server-x86_64-macos
timew-sync-server-aarch64-macos

0 comments on commit 60ac206

Please sign in to comment.