Skip to content

v0.0.3

v0.0.3 #4

Workflow file for this run

---
name: Release artifacts
on:
release:
types: [published]
workflow_dispatch:
env:
CI: true
permissions:
contents: write
jobs:
dist:
name: Build and attach dist artifacts
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout release ref
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Resolve version from release tag
id: version
run: |
set -e
version="${{ github.event.release.tag_name }}"
if [ -z "$version" ]; then
version="$(git describe --tags --exact-match 2>/dev/null || git rev-parse --short HEAD)"
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Build dist matrix
run: make dist VERSION="${{ steps.version.outputs.version }}"
- name: Smoke linux artifact
run: |
set -e
version="${{ steps.version.outputs.version }}"
tar -xzf "dist/facts-${version}-linux-amd64.tar.gz" -C /tmp
got="$(/tmp/facts-${version}-linux-amd64/facts --version)"
test "$got" = "$version"
- name: Upload dist artifacts
uses: actions/upload-artifact@v4
with:
name: facts-dist
path: |
dist/facts-*.tar.gz
dist/facts-*.zip
dist/SHA256SUMS
- name: Attach artifacts and checksums to release
if: github.event_name == 'release'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release upload "${{ github.event.release.tag_name }}" \
dist/facts-*.tar.gz \
dist/facts-*.zip \
dist/SHA256SUMS \
--clobber