Skip to content

chore: add package uploads again #29

chore: add package uploads again

chore: add package uploads again #29

Workflow file for this run

name: Validate
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
checks: write
contents: read
jobs:
build:
strategy:
matrix:
go-version: [1.22.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
fetch-tags: 'true'
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Install gotestsum
run: go install gotest.tools/gotestsum@latest
- name: Init go
run: |
go mod download
go generate .
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
- name: Test
run: |
gotestsum --format pkgname -- -covermode=atomic ./...
# Do not run release on windows
- uses: ruby/setup-ruby@v1
if: ${{ !contains(matrix.os, 'windows') }}
with:
ruby-version: '3.3'
bundler-cache: true
- run: gem install asciidoctor
if: ${{ !contains(matrix.os, 'windows') }}
- name: Setup Syft
run: curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin
if: ${{ !contains(matrix.os, 'windows') }}
- name: Prepare GPG setup
run: |
mkdir -p $GITHUB_WORKSPACE/.gnupg
echo "${{ secrets.GPG_SIGNING_KEY }}" | base64 -d > $GITHUB_WORKSPACE/.gnupg/gpg.key
if: ${{ !contains(matrix.os, 'windows') }}
- name: Snapshot release
uses: goreleaser/goreleaser-action@v5
if: ${{ !contains(matrix.os, 'windows') }}
with:
distribution: goreleaser
version: latest
args: release --clean --snapshot
env:
NFPM_GIT_AGE_PASSPHRASE: ${{ secrets.NFPM_GIT_AGE_PASSPHRASE }}