Skip to content

Add comprehensive goreleaser support #65

Add comprehensive goreleaser support

Add comprehensive goreleaser support #65

Workflow file for this run

name: Build
on:
push:
branches:
- main
- master
pull_request:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
go-version: ["1.18.x", "1.19.x", "1.20.x", "1.21.x"]
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447 # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version: ${{ matrix.go-version }}
- name: Cache mods
uses: actions/cache@6f8efc29b200d32929f49075959781ed54ec270c # v3.4.2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
- name: Download mods
run: go mod download
- name: Build
run: go build
zizmor:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447 # v6.0.2
with:
persist-credentials: false
- name: Run zizmor
uses: zizmorcore/zizmor-action@e639db99335bc9038abc0e066dfcd72e23d26fb4 # v0.3.0
with:
inputs: .github/workflows/
goreleaser-snapshot:
runs-on: ubuntu-latest
permissions:
contents: read
if: github.event_name == 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.2.2
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version: "1.21.x"
cache: false
- name: Run GoReleaser (snapshot)
uses: goreleaser/goreleaser-action@9ed2f89a662b9c5e6c31f6b2bb75f49fff0db6e8 # v6.4.0
with:
distribution: goreleaser
version: latest
args: release --snapshot --clean
- name: Upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: dist
path: dist/