license #13
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: Rust Build & Deploy | |
on: | |
push: | |
branches: [ "master" ] | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust | |
run: rustup default stable && rustup target add x86_64-unknown-linux-gnu | |
- name: Install libraries | |
run: sudo apt install libatk1.0-dev libgtk-3-dev -y | |
- name: Build | |
run: cargo build --target x86_64-unknown-linux-gnu --release | |
- uses: actions/[email protected] | |
with: | |
name: build-x86_64-unknown-linux-gnu | |
path: target/x86_64-unknown-linux-gnu/release/cuprous | |
build-windows: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust | |
run: rustup default stable && rustup target add x86_64-pc-windows-gnu | |
- name: Install gcc | |
run: sudo apt install gcc-mingw-w64-x86-64 -y | |
- name: Build | |
run: cargo build --target x86_64-pc-windows-gnu --release | |
- uses: actions/[email protected] | |
with: | |
name: build-x86_64-pc-windows-gnu | |
path: target/x86_64-pc-windows-gnu/release/cuprous.exe | |
build-web: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust | |
run: rustup default stable && rustup target add wasm32-unknown-unknown | |
- name: Build | |
run: cargo build --target wasm32-unknown-unknown -F wasm --release | |
- name: Install wasm-bindgen | |
run: cargo install wasm-bindgen-cli | |
- name: Bindgen | |
run: wasm-bindgen target/wasm32-unknown-unknown/release/cuprous.wasm --out-dir web/wasm --target web | |
- name: Package artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: web/ | |
deploy: | |
needs: | |
build-web | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |