diff --git a/.github/workflows/publish_amal.yml b/.github/workflows/publish_amal.yml index 271a1c1..7e0ccae 100644 --- a/.github/workflows/publish_amal.yml +++ b/.github/workflows/publish_amal.yml @@ -13,12 +13,27 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - - name: cargo install cpp-amalgamate - run: cargo install cpp-amalgamate + - name: Cache cpp-amalgamate + uses: actions/cache@v2 + with: + path: | + ~/.cargo/bin/cpp-amalgamate + ~/.cargo/.crates.toml + ~/.cargo/.crates2.json + key: ${{ runner.os }}-cpp-amalgamate-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cpp-amalgamate- + + - name: Install cpp-amalgamate if not cached + run: | + if ! command -v cpp-amalgamate &> /dev/null + then + cargo install cpp-amalgamate + fi - name: cpp-amalgamate run: | - rm -f amalgamated.hpp - cpp-amalgamate ./src/** >> amalgamated.hpp + rm -f bms_parser.hpp + cpp-amalgamate ./src/** >> bms_parser.hpp # create new release - name: Create Release id: create_release @@ -29,7 +44,7 @@ jobs: tag_name: ${{ github.ref }} release_name: Release ${{ github.ref }} body: | - You can find the amalgamated code in the file `amalgamated.hpp`. + You can find the amalgamated code in the file `bms_parser.hpp`. draft: false prerelease: false # upload amalgamated code @@ -40,6 +55,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./amalgamated.hpp - asset_name: amalgamated.hpp + asset_path: ./bms_parser.hpp + asset_name: bms_parser.hpp asset_content_type: text/plain \ No newline at end of file