Skip to content

v0.7.18

v0.7.18 #20

name: Archiver CLI
# Builds streaming-archiver for every platform an importer might be on and attaches the binaries to
# the release, so /manage > Settings > Imports can link to a build rather than telling
# whoever is cutting recordings to install Go and check out the repo.
#
# The asset names are a contract with App\Support\ImportCli::PLATFORMS: renaming one here
# without renaming it there produces a download button that 404s.
on:
release:
types:
- created
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- goos: darwin
goarch: arm64
asset: streaming-archiver-macos-arm64
- goos: darwin
goarch: amd64
asset: streaming-archiver-macos-amd64
- goos: windows
goarch: amd64
asset: streaming-archiver-windows-amd64.exe
- goos: linux
goarch: amd64
asset: streaming-archiver-linux-amd64
- goos: linux
goarch: arm64
asset: streaming-archiver-linux-arm64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: tools/streaming-archiver/go.mod
# Nothing to cache: the tool is stdlib only and has no go.sum.
cache: false
- name: Test
working-directory: tools/streaming-archiver
run: go test ./...
# The tag is what tells two builds apart in a bug report, so it is stamped into the
# binary rather than left at the "dev" default.
- name: Build
working-directory: tools/streaming-archiver
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: '0'
run: |
version="${GITHUB_REF_NAME}"
if [[ "${{ github.event_name }}" != "release" ]]; then
version="dev-${GITHUB_SHA::7}"
fi
go build -trimpath -ldflags "-s -w -X main.version=${version}" -o "${{ matrix.asset }}" .
- name: Upload to the release
if: ${{ github.event_name == 'release' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: tools/streaming-archiver
run: gh release upload "$GITHUB_REF_NAME" "${{ matrix.asset }}" --clobber
# A manual run has no release to attach to, so the build lands as a workflow artifact
# instead: enough to check that every platform still compiles.
- name: Upload as an artifact
if: ${{ github.event_name != 'release' }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset }}
path: tools/streaming-archiver/${{ matrix.asset }}