Skip to content

build: added gorelease and workflow #3

build: added gorelease and workflow

build: added gorelease and workflow #3

Workflow file for this run

name: goreleaser
on:
pull_request:
push:
# run only against tags
tags:
- "*"
permissions:
contents: write
packages: write
jobs:
goreleaser:
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: stable
# GPG for signing
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_KEY }}
# Gorelease full
- name: Run GoReleaser (full release, on tag)
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: "~> v1"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
# Gorelease build only
- name: Run GoReleaser (build only, on PR)
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: "~> v1"
args: build --snapshot --clean
- name: Upload assets
uses: actions/upload-artifact@v4
with:
name: qernal-cli
path: dist/*