chore: test ci :trol: #14
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: wasm-pack | |
on: | |
push: | |
branches: | |
- "main" | |
jobs: | |
check_changes: | |
runs-on: ubuntu-latest | |
outputs: | |
continue: ${{ steps.check_changes.continue }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
# Only continue to build if we actually changed anything in ./src | |
- name: check_changes | |
run: > | |
if git diff HEAD~1 --quiet ./src; then | |
echo 'continue=false' >> $GITHUB_OUTPUT | |
else | |
echo 'continue=true' >> $GITHUB_OUTPUT | |
fi | |
build: | |
runs-on: ubuntu-latest | |
needs: [check_changes] | |
if: needs.check_changes.outputs.continue == 'true' | |
permissions: | |
# Give the default GITHUB_TOKEN write permission to commit and push the | |
# added or changed files to the repository. | |
contents: write | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: install wasm-pack | |
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
- run: wasm-pack build | |
# Remove the auto-generated gitignore file. | |
- run: rm ./pkg/.gitignore | |
- name: commit | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: Build wasm. |