| 1 |
name: On Release |
| 2 |
|
| 3 |
# By default, a workflow only has read permissions. |
| 4 |
# Add the needed permission to write release assets |
| 5 |
permissions: |
| 6 |
contents: write |
| 7 |
|
| 8 |
on: |
| 9 |
release: |
| 10 |
types: |
| 11 |
- published |
| 12 |
|
| 13 |
jobs: |
| 14 |
build: |
| 15 |
name: Add Release Assets |
| 16 |
runs-on: ubuntu-latest |
| 17 |
|
| 18 |
steps: |
| 19 |
- uses: actions/checkout@v5 |
| 20 |
|
| 21 |
- name: Amalgamate fast_float.h |
| 22 |
run: | |
| 23 |
mkdir build |
| 24 |
mkdir build/fast_float |
| 25 |
python3 ./script/amalgamate.py > build/fast_float/fast_float.h |
| 26 |
|
| 27 |
- name: Test Amalgamation |
| 28 |
run: | |
| 29 |
cp tests/string_test.cpp build/ |
| 30 |
cd build |
| 31 |
g++ string_test.cpp |
| 32 |
|
| 33 |
- name: Upload Release Asset |
| 34 |
uses: actions/upload-release-asset@v1 |
| 35 |
env: |
| 36 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 37 |
with: |
| 38 |
upload_url: ${{ github.event.release.upload_url }} |
| 39 |
asset_path: build/fast_float/fast_float.h |
| 40 |
asset_name: fast_float.h |
| 41 |
asset_content_type: text/plain |