Skip to content

build: package releases for different operating systems #3

build: package releases for different operating systems

build: package releases for different operating systems #3

Workflow file for this run

name: Package this version
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
permissions:
contents: write
jobs:
prepare:
name: Publish a build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: '1.21.x'
- name: Save a snapshot
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
uses: goreleaser/goreleaser-action@v5
with:
args: build --clean --snapshot
- name: Upload artifacts
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v4
with:
name: snapshot-release
path: ./dist
- name: Distribute a release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: goreleaser/goreleaser-action@v5
with:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}