Skip to content

Commit

Permalink
Renovate and refactor the workflow (arcalot#22)
Browse files Browse the repository at this point in the history
* Update all dependencies

Signed-off-by: Platform Engineering Bot <[email protected]>

* Replace digests with semantic version tags

* Use common reusable workflow to list and test Go sources

* Rename build.yml to build.yaml

* Use global variable for Go version

---------

Signed-off-by: Platform Engineering Bot <[email protected]>
Co-authored-by: platform-engineering-bot <[email protected]>
  • Loading branch information
webbnh and platform-engineering-bot authored Apr 1, 2024
1 parent 1d1b7c1 commit 28bffa7
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 109 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
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: 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:
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
106 changes: 0 additions & 106 deletions .github/workflows/build.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/reusable_workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout this project
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4

- name: Install arcaflow-docsgen
env:
Expand All @@ -22,7 +22,7 @@ jobs:
&& tar -C /usr/local/bin -xzf arcaflow-docsgen_${{env.DOCSGEN_VER}}_linux_amd64.tar.gz
- name: Setup Python
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4
uses: actions/setup-python@v5
with:
python-version: 3.9.16

Expand All @@ -35,7 +35,7 @@ jobs:
python -m poetry config virtualenvs.in-project true
- name: Cache the virtualenv
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3
uses: actions/cache@v4
with:
path: ./.venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
Expand Down

0 comments on commit 28bffa7

Please sign in to comment.