-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (35 loc) · 863 Bytes
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
on:
push:
branches:
- master
tags:
- v*
pull_request:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Build
run: |
mkdir -p ./coffee-beans
cp coffee-beans.yaml ./coffee-beans
go build -o ./coffee-beans/coffee-beans -ldflags "-X main.version=${GITHUB_REF#refs/*/} -X main.commit=${GITHUB_SHA}"
- name: Test
run: |
go test -v ./...
- name: Package
run: |
tar -czf coffee-beans.tar.gz ./coffee-beans
- name: Release
uses: softprops/action-gh-release@v1
if: github.ref == 'refs/tags/v*'
with:
files: coffee-beans.tar.gz