diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 05590bd..5da8992 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,8 @@ -on: push +on: + release: + types: + - published + name: Build binaries @@ -19,5 +23,42 @@ jobs: with: command: build args: --release --no-default-features --features "vtf bsp" - - run: | - ls -R target \ No newline at end of file + - name: "Get upload_url" + run: echo "::set-output name=upload_url::https://uploads.github.com/repos/$GITHUB_REPOSITORY/releases/$(jq --raw-output '.release.id' $GITHUB_EVENT_PATH)/assets{?name,label}" + id: release + - name: "Upload bsp" + uses: "actions/upload-release-asset@v1" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + asset_content_type: "application/octet-stream" + asset_name: bsp_${{ matrix.os }} + asset_path: "target/release/bsp" + upload_url: ${{ steps.release.outputs.upload_url }} + - name: "Upload gma" + uses: "actions/upload-release-asset@v1" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + asset_content_type: "application/octet-stream" + asset_name: gma_${{ matrix.os }} + asset_path: "target/release/gma" + upload_url: ${{ steps.release.outputs.upload_url }} + - name: "Upload mdl" + uses: "actions/upload-release-asset@v1" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + asset_content_type: "application/octet-stream" + asset_name: mdl_${{ matrix.os }} + asset_path: "target/release/mdl" + upload_url: ${{ steps.release.outputs.upload_url }} + - name: "Upload vtf" + uses: "actions/upload-release-asset@v1" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + asset_content_type: "application/octet-stream" + asset_name: vtf_${{ matrix.os }} + asset_path: "target/release/vtf" + upload_url: ${{ steps.release.outputs.upload_url }} \ No newline at end of file