From 4d1c4df6a119ead429722f8dd93f1d4408383187 Mon Sep 17 00:00:00 2001 From: Webb Scales Date: Wed, 3 Apr 2024 17:22:37 -0400 Subject: [PATCH 1/2] Change workflow to use a reusable workflow for building the Go release --- .github/workflows/build.yaml | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5600a10..38e20c4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -14,35 +14,10 @@ jobs: uses: arcalot/arcaflow-reusable-workflows/.github/workflows/go_lint_and_test.yaml@main build: name: build - runs-on: ubuntu-latest permissions: contents: write needs: - lint_and_test - env: + with: 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 + uses: arcalot/arcaflow-reusable-workflows/.github/workflows/go_release.yaml@main From 084def3e21bc360f69f7a0a7627f3994528c8f06 Mon Sep 17 00:00:00 2001 From: Webb Scales Date: Tue, 9 Apr 2024 18:34:35 -0400 Subject: [PATCH 2/2] Pass Go version as an input to sub-workflows --- .github/workflows/build.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 38e20c4..1d61b79 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -6,18 +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 permissions: contents: write needs: - lint_and_test + 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/') }} - uses: arcalot/arcaflow-reusable-workflows/.github/workflows/go_release.yaml@main