Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Add workflows for building and publishing release binaries #56

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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