fast_float/.github/workflows/on-release.yml
Daniel Lemire e62540e95f Add manually triggered release workflow; fix on-release asset upload
- New release.yml (workflow_dispatch): bumps patch/minor/major, runs
  script/release.py, tests the amalgamation and the full test suite,
  commits and tags on main, and publishes a release with fast_float.h.
- on-release.yml: the upload failed with 'Validation Failed' because
  fast_float.h was already attached to the release. Use
  'gh release upload --clobber' instead of the deprecated
  actions/upload-release-asset, and run the amalgamation test binary.
- release.py: also bump MODULE.bazel (stuck at 8.2.4) and exit non-zero
  if amalgamation fails.
2026-10-04 12:05:40 -04:00

42 lines
1007 B
YAML

name: On Release
# By default, a workflow only has read permissions.
# Add the needed permission to write release assets
permissions:
contents: write
on:
release:
types:
- published
jobs:
build:
name: Add Release Assets
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Amalgamate fast_float.h
run: |
mkdir build
mkdir build/fast_float
python3 ./script/amalgamate.py > build/fast_float/fast_float.h
- name: Test Amalgamation
run: |
cp tests/string_test.cpp build/
cd build
g++ string_test.cpp
./a.out
- name: Upload Release Asset
# --clobber replaces an asset that was already attached by hand, which
# would otherwise make the upload fail.
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release upload "${{ github.event.release.tag_name }}" \
build/fast_float/fast_float.h --clobber