Skip to content

Commit 223e224

Browse files
committed
Add Github Actions configuration
1 parent c557094 commit 223e224

File tree

3 files changed

+49
-13
lines changed

3 files changed

+49
-13
lines changed

.github/workflows/build.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
set -ex
4+
5+
go generate ./...
6+
7+
GOOS=${OS}
8+
[ "$GOOS" = "macos" ] && GOOS=darwin
9+
GOARCH="${ARCH}" GOOS="$GOOS" go build -tags netgo -o cftest ./cmd/cftest
10+
11+
mkdir -p build/cftest
12+
cp README.md build/cftest
13+
cp cftest build/cftest/cftest
14+
15+
cd build
16+
tar -czf "cftest-${OS}-${ARCH}-${REF}.tgz" cftest

.github/workflows/build.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build
2+
on: [push]
3+
env:
4+
GOPRIVATE: "github.com/paulhammond"
5+
jobs:
6+
build:
7+
name: Build
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
os: ["macos", "linux"]
12+
arch: ["arm64", "amd64"]
13+
fail-fast: false
14+
steps:
15+
- name: Checkout repo
16+
uses: actions/checkout@v4
17+
- name: Setup Go
18+
uses: actions/setup-go@v5
19+
with:
20+
go-version: '1.22.0'
21+
- name: Test
22+
run: go test -v ./...
23+
- name: Build
24+
env:
25+
OS: ${{ matrix.os }}
26+
ARCH: ${{ matrix.arch }}
27+
REF: ${{ github.sha }}
28+
run: "./.github/workflows/build.sh"
29+
- name: Upload
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: "cftest-${{matrix.os}}-${{matrix.arch}}-${{github.sha}}.tgz"
33+
path: "build/cftest-${{matrix.os}}-${{matrix.arch}}-${{github.sha}}.tgz"

Dockerfile

-13
This file was deleted.

0 commit comments

Comments
 (0)