Skip to content

Update ci

Update ci #14

Workflow file for this run

name: Build and Release
on:
push:
tags:
- "v*" # Aciona apenas para tags que começam com "v"
jobs:
build:
runs-on: ${{ matrix.os }}
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: |
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: |
cd target/release && zip -r "Secret Santa.app.zip" "Secret Santa.app"
- name: Upload artifact for macOS
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v3
with:
name: secret-santa-macos
path: target/release/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 }}