0.0.4 #4
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: Publish | |
on: | |
push: | |
tags: | |
- "v*" | |
env: | |
CARGO_INCREMENTAL: 0 | |
CARGO_TERM_COLOR: "always" | |
RUST_LOG: "off" | |
jobs: | |
wasm-build: | |
name: Wasm build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install wasm-pack | |
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
- name: Build wasm | |
run: ./crates/lua_fmt/scripts/build.sh | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build | |
path: crates/lua_fmt/pkg | |
publish-npm: | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
needs: wasm-build | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: build | |
path: crates/lua_fmt/pkg/ | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".node-version" | |
registry-url: "https://registry.npmjs.org" | |
- name: Publish | |
working-directory: crates/lua_fmt/pkg | |
run: npm publish --provenance | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
publish-jsr: | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
needs: wasm-build | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: build | |
path: crates/lua_fmt/pkg/ | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".node-version" | |
registry-url: "https://registry.npmjs.org" | |
- name: Publish | |
working-directory: crates/lua_fmt/pkg | |
run: npx jsr publish | |
publish-github: | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
needs: wasm-build | |
permissions: | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: build | |
path: crates/lua_fmt/pkg/ | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".node-version" | |
registry-url: "https://npm.pkg.github.com" | |
- name: Publish | |
working-directory: crates/lua_fmt/pkg | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
publish-github-release: | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
needs: wasm-build | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: build | |
path: crates/lua_fmt/pkg/ | |
- name: Package | |
working-directory: crates/lua_fmt/pkg | |
run: npm pack | |
- name: Release | |
uses: softprops/action-gh-release@1ce812a7bd7fa6c191ed3334eeace31579a98f25 | |
with: | |
files: | | |
crates/*/pkg/*.tgz | |
crates/*/pkg/*.wasm |