0.1.2 #43
This file contains hidden or 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 | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Install wasm-pack | |
| run: | | |
| curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
| - name: Checkout built branch | |
| run: | | |
| git checkout built || git checkout -b built | |
| git reset --hard origin/main | |
| - name: Build WASM (Release) | |
| run: | | |
| cd nicehtml_transpiler | |
| wasm-pack build --target web --release | |
| cd .. | |
| - name: Configure Git | |
| run: | | |
| git config user.name "GitHub Actions" | |
| git config user.email "actions@github.com" | |
| - name: Commit and Push Changes | |
| run: | | |
| git add -f nicehtml_transpiler/pkg | |
| git commit -m "Deploy release build to built branch" || exit 0 | |
| git push -f origin built |