[Playground] Release #2037
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: "[Playground] Release" | |
on: | |
workflow_dispatch: | |
release: | |
types: [published] | |
env: | |
CARGO_INCREMENTAL: 0 | |
CARGO_NET_RETRY: 10 | |
CARGO_TERM_COLOR: always | |
RUSTUP_MAX_RETRIES: 10 | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
env: | |
CF_API_TOKEN_EXISTS: ${{ secrets.CF_API_TOKEN != '' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Install Rust toolchain" | |
run: rustup target add wasm32-unknown-unknown | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "npm" | |
cache-dependency-path: playground/package-lock.json | |
- uses: jetli/wasm-pack-action@v0.4.0 | |
- uses: jetli/wasm-bindgen-action@v0.2.0 | |
- name: "Run wasm-pack" | |
run: wasm-pack build --target web --out-dir ../../playground/src/pkg crates/ruff_wasm | |
- name: "Install Node dependencies" | |
run: npm ci | |
working-directory: playground | |
- name: "Run TypeScript checks" | |
run: npm run check | |
working-directory: playground | |
- name: "Build JavaScript bundle" | |
run: npm run build | |
working-directory: playground | |
- name: "Deploy to Cloudflare Pages" | |
if: ${{ env.CF_API_TOKEN_EXISTS == 'true' }} | |
uses: cloudflare/wrangler-action@v3.1.1 | |
with: | |
apiToken: ${{ secrets.CF_API_TOKEN }} | |
accountId: ${{ secrets.CF_ACCOUNT_ID }} | |
command: pages deploy playground/dist --project-name=ruff-playground --branch ${GITHUB_HEAD_REF} --commit-hash ${GITHUB_SHA} |