Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change workflow to use a reusable workflow for building the Go release #23

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 5 additions & 29 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,19 @@ on:
tags:
- v*
pull_request:
env:
go_version: ${{ vars.ARCALOT_GO_VERSION }}
jobs:
lint_and_test:
name: lint and test
uses: arcalot/arcaflow-reusable-workflows/.github/workflows/go_lint_and_test.yaml@main
with:
go_version: ${{ vars.ARCALOT_GO_VERSION }}
build:
name: build
runs-on: ubuntu-latest
permissions:
contents: write
needs:
- lint_and_test
env:
uses: arcalot/arcaflow-reusable-workflows/.github/workflows/go_release.yaml@main
with:
go_version: ${{ vars.ARCALOT_GO_VERSION }}
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