-
Notifications
You must be signed in to change notification settings - Fork 3
50 lines (42 loc) · 1.39 KB
/
build.yml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: CI
on:
workflow_dispatch:
inputs:
version:
description: "Version"
required: false
default: "0.6.0"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.23
- name: Install dependencies
run: |
go mod tidy
go get -u golang.org/x/sys # for Windows build
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
- name: Linters check
run: golangci-lint run ./...
- name: Build binaries
run: |
version="${{ github.event.inputs.version }}"
[ -z "$version" ] && version="latest"
mkdir -p bin
architectures=("amd64" "arm64")
for arch in "${architectures[@]}"; do
GOOS=linux GOARCH=$arch go build -o bin/lazyjournal-$version-linux-$arch
GOOS=darwin GOARCH=$arch go build -o bin/lazyjournal-$version-darwin-$arch
GOOS=windows GOARCH=$arch go build -o bin/lazyjournal-$version-windows-$arch.exe
done
echo "ARTIFACT_NAME=lazyjournal-$(date +'%d.%m.%Y')" >> $GITHUB_ENV
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: bin/