Skip to content

Commit

Permalink
Github action to upload on release
Browse files Browse the repository at this point in the history
  • Loading branch information
loriopatrick committed Aug 26, 2023
1 parent ee95499 commit 1cb2554
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 27 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Build Release

on:
release:
types: [created]

jobs:
build:
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
- name: build release
uses: actions-rs/cargo@v1
with:
command: build
args: --release --all
- name: upload playit-cli
uses: actions/upload-artifact@v3
with:
name: playit-${{ matrix.platform }}
path: ./target/release/playit-cli
upload:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download macos
uses: actions/download-artifact@v3
with:
name: playit-macos-latest
- name: Download linux
uses: actions/download-artifact@v3
with:
name: playit-ubuntu-latest
- name: Download windows
uses: actions/download-artifact@v3
with:
name: playit-windows-latest

- name: Upload MacOS
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./playit-macos-latest
asset_name: playit-darwin

- name: Upload Linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./playit-ubuntu-latest
asset_name: playit-amd64

- name: Upload Windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./playit-windows-latest
asset_name: playit.exe
27 changes: 0 additions & 27 deletions .github/workflows/manual-build.yml

This file was deleted.

0 comments on commit 1cb2554

Please sign in to comment.