Skip to content

chore: docs

chore: docs #174

Workflow file for this run

name: Release
on:
workflow_dispatch:
push:
tags:
- "v*"
env:
GO_VERSION: "1.22.x"
jobs:
build:
name: Build Binaries
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-22.04, macos-latest ]
steps:
- uses: actions/checkout@v4
- name: Setup Go environment
uses: actions/setup-go@v5
with:
go-version: "${{ env.GO_VERSION }}"
- name: Setup CI Tools
run: make ci-setup
- name: Run Go Tests
run: make test
- name: Install Homebrew on macOS
if: runner.os == 'macOS'
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
brew install mingw-w64
- name: Build Binary
run: make build-cross
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-artifacts
path: dist/*
retention-days: 1
if-no-files-found: error
collect-artifacts:
name: Collect Artifacts and Generate Checksums
runs-on: ubuntu-22.04
needs: build
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: ubuntu-22.04-artifacts
path: dist
merge-multiple: true
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: macos-latest-artifacts
path: dist
merge-multiple: true
- name: Calculate Checksums
run: |
cd dist
sha256sum knowledge-* > checksums.txt
- name: Upload Checksums
uses: actions/upload-artifact@v4
with:
name: checksums
path: dist/checksums.txt
release:
name: Create Release
runs-on: ubuntu-22.04
needs: collect-artifacts
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: ubuntu-22.04-artifacts
path: dist
merge-multiple: true
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: macos-latest-artifacts
path: dist
- name: Download Checksums
uses: actions/download-artifact@v4
with:
name: checksums
path: dist
merge-multiple: true
- name: Extract Tag from Ref
if: startsWith(github.ref, 'refs/tags/')
id: tag
run: echo VERSION=${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT
shell: bash
- uses: apexskier/github-semver-parse@v1
if: startsWith(github.ref, 'refs/tags/')
id: semver
with:
version: ${{ steps.tag.outputs.VERSION }}
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: |
dist/*
makeLatest: ${{ steps.semver.outputs.prerelease == '' }}
generateReleaseNotes: true
prerelease: ${{ steps.semver.outputs.prerelease != '' }}
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}