Skip to content

Commit 04d3618

Browse files
committed
Add CI
1 parent f23f855 commit 04d3618

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags: ["v*"]
7+
pull_request:
8+
branches: [main]
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-go@v5
16+
with:
17+
go-version-file: go.mod
18+
- run: go test ./...
19+
20+
build:
21+
runs-on: ubuntu-latest
22+
needs: test
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: actions/setup-go@v5
26+
with:
27+
go-version-file: go.mod
28+
29+
- name: Build doubletake
30+
run: CGO_ENABLED=0 go build -ldflags='-s -w -extldflags=-static' -o doubletake ./cmd/doubletake
31+
32+
- name: Build doubletake-ctl
33+
run: CGO_ENABLED=0 go build -ldflags='-s -w -extldflags=-static' -o doubletake-ctl ./cmd/doubletake-ctl
34+
35+
- uses: actions/upload-artifact@v4
36+
with:
37+
name: binaries
38+
path: |
39+
doubletake
40+
doubletake-ctl
41+
42+
release:
43+
if: startsWith(github.ref, 'refs/tags/v')
44+
runs-on: ubuntu-latest
45+
needs: build
46+
permissions:
47+
contents: write
48+
steps:
49+
- uses: actions/download-artifact@v4
50+
with:
51+
name: binaries
52+
53+
- name: Create GitHub Release
54+
uses: softprops/action-gh-release@v2
55+
with:
56+
files: |
57+
doubletake
58+
doubletake-ctl

0 commit comments

Comments
 (0)