Skip to content

docs(wiki): add wiki pages and wiki-sync CI workflow #3

docs(wiki): add wiki pages and wiki-sync CI workflow

docs(wiki): add wiki pages and wiki-sync CI workflow #3

Workflow file for this run

name: release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to release (e.g. v2026.5.22.0)'
required: true
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: true
- name: Resolve version from tag
id: ver
shell: pwsh
run: |
$tag = "${{ github.event.inputs.tag }}"
if (-not $tag) { $tag = "${{ github.ref_name }}" }
# Strip leading 'v' from the tag to land the family YYYY.M.D.N
# scheme into the binary version string. Tags MUST start with 'v'.
if (-not $tag.StartsWith('v')) {
throw "tag '$tag' does not start with 'v'"
}
$version = $tag.Substring(1)
# Sanity-check the YYYY.M.D.N(-XXXX) shape so a fat-fingered
# tag fails the release rather than shipping a broken version.
if ($version -notmatch '^\d{4}\.\d+\.\d+\.\d+(-[A-Fa-f0-9]{4})?$') {
throw "version '$version' does not match the YYYY.M.D.N(-XXXX) shape"
}
"tag=$tag" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
"version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
Write-Host "tag=$tag version=$version"
- name: Fetch picotool
shell: pwsh
run: |
./scripts/fetch-picotool.ps1
- name: Build with embedded picotool
shell: pwsh
env:
GOOS: windows
GOARCH: amd64
CGO_ENABLED: '0'
HANDOFF_VERSION: ${{ steps.ver.outputs.version }}
run: |
go build -trimpath -ldflags="-s -w -X main.version=$env:HANDOFF_VERSION" -tags embed_picotool -o handoff.exe .
./handoff.exe version
- name: Write release manifest
id: manifest
shell: pwsh
env:
HANDOFF_VERSION: ${{ steps.ver.outputs.version }}
HANDOFF_TAG: ${{ steps.ver.outputs.tag }}
run: |
$sha = (Get-FileHash -Algorithm SHA256 handoff.exe).Hash.ToLower()
$manifest = [ordered]@{
version = $env:HANDOFF_VERSION
sha256 = $sha
url = "https://github.com/${{ github.repository }}/releases/download/$env:HANDOFF_TAG/handoff.exe"
notes = "Release $env:HANDOFF_TAG"
}
$manifest | ConvertTo-Json -Compress | Out-File -FilePath handoff-version.json -Encoding ASCII
Get-Content handoff-version.json
- name: Upload release assets
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.ver.outputs.tag }}
files: |
handoff.exe
handoff-version.json
generate_release_notes: true
draft: false
prerelease: ${{ contains(steps.ver.outputs.version, '-') }}