Skip to content

Release

Release #11

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to release (e.g. v0.1.11). Created if it does not already exist.'
required: true
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.goos }}/${{ matrix.goarch }}
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.value }}
strategy:
matrix:
include:
- goos: darwin
goarch: arm64
- goos: darwin
goarch: amd64
- goos: linux
goarch: arm64
- goos: linux
goarch: amd64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Resolve version
id: version
run: echo "value=${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}" >> "$GITHUB_OUTPUT"
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: |
go build -trimpath -ldflags="-s -w -X main.version=${{ steps.version.outputs.value }}" \
-o dossier-${{ matrix.goos }}-${{ matrix.goarch }} \
./cmd/dossier
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: dossier-${{ matrix.goos }}-${{ matrix.goarch }}
path: dossier-${{ matrix.goos }}-${{ matrix.goarch }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Create checksums
run: sha256sum dossier-* > checksums.txt
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.build.outputs.version }}
files: |
dossier-*
checksums.txt
generate_release_notes: true