From b5942acec1423c2b8098a6f3de934ed463382b04 Mon Sep 17 00:00:00 2001 From: John Trowbridge Date: Tue, 19 May 2020 01:04:19 +0000 Subject: [PATCH] Add github action to publish release artifacts This adds an action which runs when a "v*" tag is pushed to the repo. This action does a basic release build on ubuntu-latest and then creates a release and uploads the release binary to that release. --- .github/workflows/publish.yml | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..3f02a56 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,36 @@ +name: "Publish release artifacts" +# Publishes release artifacts when a git tag is pushed that starts with v +on: + push: + tags: + - 'v*' + +jobs: + build: + name: Publish Release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build + run: cargo build --release + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./target/release/coretoolbox + asset_name: coretoolbox + asset_content_type: application/octet-stream +