Skip to content

Use global variable for Go version #2

Use global variable for Go version

Use global variable for Go version #2

Workflow file for this run

name: Build
on:
push:
branches:
- main
tags:
- v*
pull_request:
env:
go_version: ${{ vars.ARCALOT_GO_VERSION }}
jobs:
lint_and_test:
name: lint and test
uses: webbnh/arcaflow-reusable-workflows/.github/workflows/go_lint_and_test.yaml@main # FIXME: should be arcalot/...@v<tag>
build:
name: build
runs-on: ubuntu-latest
permissions:
contents: write
needs:
- lint_and_test
env:
for_release: ${{ startsWith(github.event.ref, 'refs/tags/') }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
- name: Build ${{ env.for_release == 'true' && 'release' || 'snapshot' }}
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: ${{ env.ARGS }}
env:
GITHUB_TOKEN: ${{ env.for_release == 'true' && secrets.GITHUB_TOKEN || '' }}
GOPROXY: direct
GOSUMDB: off
ARGS: ${{ env.for_release == 'true' && 'release --clean' || 'build --snapshot' }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: binaries
path: dist