Skip to content

test(errdefs): use more helpers, increase test coverage #10

test(errdefs): use more helpers, increase test coverage

test(errdefs): use more helpers, increase test coverage #10

name: goreleaser-dev
# ref. https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
on:
push:
branches: ["main"]
pull_request:
paths:
- .github/workflows/golangci-lint.yml
- .github/workflows/goreleaser-dev.yml
- "**.go"
- go.mod
- go.sum
- .goreleaser*
branches: ["**"]
permissions:
contents: write
jobs:
release:
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix
strategy:
matrix:
job:
# use ubuntu20.04 as default one, for backward compatibility
- os: ubuntu-20.04
platform: linux
target: linux_amd64
- os: ubuntu-20.04
platform: linux
target: linux_amd64
goreleaser_suffix: _ubuntu20.04
- os: ubuntu-20.04
platform: linux
target: linux_arm64
goreleaser_suffix: _ubuntu20.04
- os: ubuntu-22.04
platform: linux
target: linux_amd64
goreleaser_suffix: _ubuntu22.04
- os: ubuntu-22.04
platform: linux
target: linux_arm64
goreleaser_suffix: _ubuntu22.04
- os: ubuntu-24.04
platform: linux
target: linux_amd64
goreleaser_suffix: _ubuntu24.04
- os: ubuntu-24.04
platform: linux
target: linux_arm64
goreleaser_suffix: _ubuntu24.04
- os: macos-latest
platform: darwin
target: darwin_amd64
- os: macos-latest
platform: darwin
target: darwin_arm64
name: Release ${{ matrix.job.target }} (${{ matrix.job.os }})
runs-on: ${{ matrix.job.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install OS dependencies
shell: bash
run: |
case ${{ matrix.job.target }} in
linux_arm64) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;;
esac
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Show version information
shell: bash
run: |
gcc --version || true
go version
# https://github.com/goreleaser/goreleaser-action
- name: Run GoReleaser in snapshot mode
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --snapshot --config .goreleaser_${{ matrix.job.target }}${{ matrix.job.goreleaser_suffix }}.yaml
workdir: .
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}