Skip to content

Commit

Permalink
Release-based github action
Browse files Browse the repository at this point in the history
  • Loading branch information
wyozi committed Jun 28, 2020
1 parent 0026e81 commit c9027d8
Showing 1 changed file with 44 additions and 3 deletions.
47 changes: 44 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
on: push
on:
release:
types:
- published


name: Build binaries

Expand All @@ -19,5 +23,42 @@ jobs:
with:
command: build
args: --release --no-default-features --features "vtf bsp"
- run: |
ls -R target
- 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 }}

0 comments on commit c9027d8

Please sign in to comment.