build: update actions workflows #2
Workflow file for this run
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: Build | |
on: | |
push: | |
branches: | |
- "master" | |
tags: | |
- 'v*' | |
paths-ignore: | |
- '.github/ISSUE_TEMPLATE/**' | |
- '.github/images/**' | |
- 'config.yaml' | |
- 'docker-compose.yml' | |
- 'Makefile' | |
- '**.md' | |
pull_request: | |
paths-ignore: | |
- '.github/ISSUE_TEMPLATE/**' | |
- '.github/images/**' | |
- 'config.yaml' | |
- 'docker-compose.yml' | |
- 'Makefile' | |
- '**.md' | |
env: | |
REGISTRY: ghcr.io | |
REGISTRY_IMAGE: ghcr.io/${{ github.repository }} | |
GO_VERSION: '1.23' | |
permissions: | |
contents: write | |
packages: write | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
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 }} | |
cache: true | |
- name: Test | |
run: go run gotest.tools/gotestsum@latest --junitfile unit-tests.xml --format pkgname -- ./... | |
- name: Test Summary | |
uses: test-summary/action@v2 | |
with: | |
paths: "unit-tests.xml" | |
if: always() | |
goreleaser: | |
name: Build and publish Go binaries | |
runs-on: ubuntu-latest | |
needs: [test] | |
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 }} | |
cache: true | |
- name: Run GoReleaser build | |
if: github.event_name == 'pull_request' | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
distribution: goreleaser | |
version: "~> v2" | |
args: release --clean --skip=validate,publish --parallelism 5 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run GoReleaser build and publish tags | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
distribution: goreleaser | |
version: "~> v2" | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload assets | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tqm | |
path: | | |
dist/*.tar.gz | |
dist/*.json | |
dist/*.yaml |