From 6951df1b19f69c1df86b8ac6ed441344a597c9e9 Mon Sep 17 00:00:00 2001 From: Adam Lugowski Date: Fri, 26 May 2023 16:41:12 -0700 Subject: [PATCH] Add on-release workflow --- .github/workflows/on-release.yml | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/on-release.yml diff --git a/.github/workflows/on-release.yml b/.github/workflows/on-release.yml new file mode 100644 index 0000000..f734e9e --- /dev/null +++ b/.github/workflows/on-release.yml @@ -0,0 +1,41 @@ +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@v3 + + - 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 + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: build/fast_float/fast_float.h + asset_name: fast_float.h + asset_content_type: text/plain