build-apps #7
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-apps' | |
on: workflow_dispatch | |
jobs: | |
build-binaries: | |
permissions: | |
contents: write | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- os: ubuntu-latest | |
rust_target: x86_64-unknown-linux-gnu | |
- os: macos-latest | |
rust_target: x86_64-apple-darwin | |
- os: macos-latest | |
rust_target: aarch64-apple-darwin | |
- os: windows-latest | |
rust_target: x86_64-pc-windows-msvc | |
runs-on: ${{ matrix.platform.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: 'Setup Rust' | |
uses: actions-rs/toolchain@v1 | |
with: | |
default: true | |
override: true | |
profile: minimal | |
toolchain: nightly | |
target: ${{ matrix.platform.rust_target }} | |
- name: install cargo-leptos | |
run: cargo install cargo-leptos | |
- name: install trunk | |
run: cargo install trunk | |
- name: install wasm target | |
run: rustup target add wasm32-unknown-unknown | |
- name: install | |
if: matrix.platform.os == 'macos-latest' | |
run: npm install @tauri-apps/cli-darwin-arm64 | |
- name: install dependencies (ubuntu only) | |
if: matrix.platform.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
# webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2. | |
# You can remove the one that doesn't apply to your app to speed up the workflow a bit. | |
- uses: JonasKruckenberg/tauri-build@v1 | |
id: build_game | |
with: | |
projectPath: hes-game | |
target: ${{ matrix.platform.rust_target }} | |
- uses: JonasKruckenberg/tauri-build@v1 | |
id: build_editor | |
with: | |
projectPath: hes-editor | |
target: ${{ matrix.platform.rust_target }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: game-artifacts | |
path: "${{ join(fromJSON(steps.build_game.outputs.artifacts), '\n') }}" | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: editor-artifacts | |
path: "${{ join(fromJSON(steps.build_editor.outputs.artifacts), '\n') }}" | |
publish: | |
needs: build-binaries | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Download the previously uploaded artifacts | |
- uses: actions/download-artifact@v3 | |
with: | |
name: game-artifacts | |
path: artifacts/game | |
- uses: actions/download-artifact@v3 | |
with: | |
name: editor-artifacts | |
path: artifacts/editor | |
# And create a release with the artifacts attached | |
- name: 'create release' | |
uses: softprops/action-gh-release@master | |
env: | |
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | |
with: | |
draft: false | |
files: ./artifacts/**/* |