Fix Web viewport #1562
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: Github Deploy | |
on: | |
push: | |
branches: [main] | |
tags: [v*] | |
jobs: | |
cargo-publish: | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- run: | | |
cargo login ${{ secrets.CRATE_IO }} | |
cargo publish -p four-bar || true | |
cargo publish -p four-bar-ui || true | |
gh-test-release: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
asset_name: four-bar-linux-amd64 | |
artifact_name: target/release/four-bar | |
- os: ubuntu-latest | |
asset_name: four-bar-wasm-unknown | |
artifact_name: four-bar-ui/dist/ | |
- os: macos-latest | |
asset_name: four-bar-macos-amd64 | |
artifact_name: target/release/four-bar | |
- os: windows-latest | |
asset_name: four-bar-windows-amd64 | |
artifact_name: target/release/four-bar.exe | |
runs-on: ${{ matrix.os }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- if: matrix.asset_name == 'four-bar-linux-amd64' | |
name: Linux requirements | |
run: | | |
sudo apt update | |
sudo apt install -y libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libgtk-3-dev | |
- if: matrix.asset_name == 'four-bar-wasm-unknown' | |
name: WASM Build | |
working-directory: four-bar-ui | |
run: | | |
rustup target add wasm32-unknown-unknown | |
cargo install trunk | |
trunk build --release --filehash=false | |
# For GH-Pages | |
trunk build --release --filehash=false --public-url=/four-bar-rs/ --dist=docs | |
- if: matrix.asset_name != 'four-bar-wasm-unknown' | |
name: Native Build | |
run: | | |
cargo clippy -- -D warnings | |
cargo test -p four-bar | |
cargo build --release --features=native-win-release | |
- name: Pack | |
uses: vimtor/action-zip@v1 | |
with: | |
files: ${{ matrix.artifact_name }} | |
dest: ${{ matrix.asset_name }}.zip | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.asset_name }} | |
path: ${{ matrix.artifact_name }} | |
if-no-files-found: error | |
- if: startsWith(github.ref, 'refs/tags/v') | |
name: Release binary | |
uses: softprops/action-gh-release@v1 | |
with: | |
token: ${{ secrets.PUBLISH_TOKEN }} | |
files: ${{ matrix.asset_name }}.zip | |
- if: matrix.asset_name == 'four-bar-wasm-unknown' | |
name: Deploy to gh-pages | |
uses: JamesIves/github-pages-deploy-action@releases/v4 | |
with: | |
token: ${{ secrets.PUBLISH_TOKEN }} | |
folder: four-bar-ui/docs | |
clean: true |