CI #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "Version" | |
required: false | |
default: "0.7.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 install github.com/golangci/golangci-lint/cmd/golangci-lint@latest | |
go install -v github.com/go-critic/go-critic/cmd/gocritic@latest | |
- name: Golangci linters check | |
run: | | |
golangci-lint run ./... | |
golangci-lint run ./... --config ./.golangci-enable-all.yml | |
- name: Gocritic linters check | |
run: gocritic check -enableAll ./... | |
- 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=openbsd GOARCH=$arch go build -o bin/lazyjournal-$version-openbsd-$arch | |
GOOS=freebsd GOARCH=$arch go build -o bin/lazyjournal-$version-freebsd-$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/ |