Add cargo bundle on ci build #22
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
permissions: | |
contents: write | |
strategy: | |
matrix: | |
os: [windows-latest, macos-latest] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
components: rustfmt, clippy | |
- name: Setup target for Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
rustup target add wasm32-unknown-unknown && cargo install --locked wasm-bindgen-cli && cargo install cargo-binstall && cargo binstall trunk | |
- name: Build project for Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
make build-win | |
- name: Build project for macOS | |
if: matrix.os == 'macos-latest' | |
run: | | |
cargo install cargo-bundle && make build-mac | |
- name: Upload artifact for Windows | |
if: matrix.os == 'windows-latest' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: secret-santa-windows | |
path: target/release/secret-santa.exe | |
- name: Compress Secret Santa.app | |
if: matrix.os == 'macos-latest' | |
run: | | |
zip -r "Secret Santa.app.zip" "/target/release/bundle/osx/Secret Santa.app" | |
- name: Upload artifact for macOS | |
if: matrix.os == 'macos-latest' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: secret-santa-macos | |
path: Secret Santa.app.zip | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
target/release/secret-santa.exe | |
Secret Santa.app.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |