Skip to content

CI

CI #3

Workflow file for this run

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/