Skip to content

docs: prepare v0.2.3 changelog #7

docs: prepare v0.2.3 changelog

docs: prepare v0.2.3 changelog #7

Workflow file for this run

name: release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
name: build ${{ matrix.goos }}-${{ matrix.goarch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Set up Node
if: matrix.goos == 'linux' && matrix.goarch == 'amd64'
uses: actions/setup-node@v4
with:
node-version: "22.14.0"
- name: Run dashboard JavaScript unit tests
if: matrix.goos == 'linux' && matrix.goarch == 'amd64'
run: node --test internal/dashboard/static/dashboard.test.js
- name: Build release archive
env:
CGO_ENABLED: 0
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
RELEASE_TAG: ${{ github.ref_name }}
run: |
set -eu
mkdir -p dist
binary_name="statlite"
out_dir="dist/statlite_${GOOS}_${GOARCH}"
archive_name="statlite_${RELEASE_TAG#v}_${GOOS}_${GOARCH}.tar.gz"
mkdir -p "${out_dir}"
go build -trimpath -ldflags="-s -w -X github.com/pvrlabs/statlite/internal/version.Version=${RELEASE_TAG}" -o "${out_dir}/${binary_name}" ./cmd/statlite
cp internal/dashboard/static/vendor/CHARTJS-LICENSE.md "${out_dir}/LICENSE-Chart.js.md"
cp internal/dashboard/static/fonts/ORBITRON-LICENSE.txt "${out_dir}/LICENSE-Orbitron.txt"
tar -czf "dist/${archive_name}" -C "${out_dir}" "${binary_name}" "LICENSE-Chart.js.md" "LICENSE-Orbitron.txt"
sha256sum "dist/${archive_name}" > "dist/${archive_name}.sha256"
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: release-${{ matrix.goos }}-${{ matrix.goarch }}
path: |
dist/*.tar.gz
dist/*.tar.gz.sha256
if-no-files-found: error
publish:
name: publish release assets
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: release-assets
merge-multiple: true
- name: Generate release notes
id: notes
run: |
bash scripts/generate-release-notes.sh "${{ github.ref_name }}" > release-notes.md
echo "notes_file=release-notes.md" >> "$GITHUB_OUTPUT"
- name: Publish release assets
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
body_path: ${{ steps.notes.outputs.notes_file }}
files: |
release-assets/*.tar.gz
release-assets/*.tar.gz.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}