Skip to content

ci: fix archive creation #35

ci: fix archive creation

ci: fix archive creation #35

Workflow file for this run

name: CI/CD
on:
push:
workflow_dispatch:
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
changes:
name: Detect affected workspaces
runs-on: ubuntu-latest
outputs:
paper-js: ${{ steps.filter.outputs.paper-js }}
scratch-audio: ${{ steps.filter.outputs.scratch-audio }}
scratch-blocks: ${{ steps.filter.outputs.scratch-blocks }}
scratch-paint: ${{ steps.filter.outputs.scratch-paint }}
scratch-svg-renderer: ${{ steps.filter.outputs.scratch-svg-renderer }}
scratch-render: ${{ steps.filter.outputs.scratch-render }}
scratch-sb1-converter: ${{ steps.filter.outputs.scratch-sb1-converter }}
scratch-storage: ${{ steps.filter.outputs.scratch-storage }}
scratch-vm: ${{ steps.filter.outputs.scratch-vm }}
scratch-gui: ${{ steps.filter.outputs.scratch-gui }}
steps:
- uses: actions/checkout@v4 # TODO: skip this for PRs
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
any-workspace:
- ".github/workflows/workspace-*.yml"
- "workspaces/**"
paper-js:
- ".github/workflows/workspace-paper-js.yml"
- "workspaces/paper.js/**"
scratch-audio:
- ".github/workflows/workspace-scratch-audio.yml"
- "workspaces/scratch-audio/**"
scratch-blocks:
- ".github/workflows/workspace-scratch-blocks.yml"
- "workspaces/scratch-blocks/**"
scratch-paint:
- ".github/workflows/workspace-scratch-paint.yml"
- "workspaces/paper.js/**"
- "workspaces/scratch-paint/**"
scratch-svg-renderer:
- ".github/workflows/workspace-scratch-svg-renderer.yml"
- "workspaces/scratch-svg-renderer/**"
scratch-render:
- ".github/workflows/workspace-scratch-render.yml"
- "workspaces/scratch-render/**"
- "workspaces/scratch-storage/**"
- "workspaces/scratch-svg-renderer/**"
scratch-sb1-converter:
- ".github/workflows/workspace-scratch-sb1-converter.yml"
- "workspaces/scratch-sb1-converter/**"
scratch-storage:
- ".github/workflows/workspace-scratch-storage.yml"
- "workspaces/scratch-storage/**"
scratch-vm:
- ".github/workflows/workspace-scratch-vm.yml"
- "workspaces/scratch-sb1-converter/**"
- "workspaces/scratch-vm/**"
scratch-gui:
- ".github/workflows/workspace-scratch-gui.yml"
- "workspaces/paper.js/**"
- "workspaces/scratch-audio/**"
- "workspaces/scratch-blocks/**"
- "workspaces/scratch-gui/**"
- "workspaces/scratch-paint/**"
- "workspaces/scratch-render/**"
- "workspaces/scratch-sb1-converter/**"
- "workspaces/scratch-storage/**"
- "workspaces/scratch-svg-renderer/**"
- "workspaces/scratch-vm/**"
- if: ${{ steps.filter.outputs.any-workspace == 'true' }}
uses: actions/setup-node@v3
with:
cache: npm
node-version-file: .nvmrc
- if: ${{ steps.filter.outputs.any-workspace == 'true' }}
uses: ./.github/actions/install-libraries
- if: ${{ steps.filter.outputs.any-workspace == 'true' }}
env:
NODE_ENV: development
run: npm ci
- if: ${{ steps.filter.outputs.any-workspace == 'true' }}
run:
tar --zstd -cvf node_modules.tar.zst node_modules workspaces/*/node_modules
- if: ${{ steps.filter.outputs.any-workspace == 'true' }}
uses: actions/upload-artifact@v3
with:
name: node-modules
path: node_modules.tar.zst
retention-days: 1
paper-js:
uses: ./.github/workflows/workspace-paper-js.yml
if: ${{ !failure() && !cancelled() && needs.changes.outputs.paper-js == 'true' }}
needs:
- changes
scratch-audio:
uses: ./.github/workflows/workspace-scratch-audio.yml
if: ${{ !failure() && !cancelled() && needs.changes.outputs.scratch-audio == 'true' }}
needs:
- changes
scratch-blocks:
uses: ./.github/workflows/workspace-scratch-blocks.yml
if: ${{ !failure() && !cancelled() && needs.changes.outputs.scratch-blocks == 'true' }}
needs:
- changes
scratch-paint:
uses: ./.github/workflows/workspace-scratch-paint.yml
if: ${{ !failure() && !cancelled() && needs.changes.outputs.scratch-paint == 'true' }}
needs:
- changes
- paper-js
scratch-svg-renderer:
uses: ./.github/workflows/workspace-scratch-svg-renderer.yml
if: ${{ !failure() && !cancelled() && needs.changes.outputs.scratch-svg-renderer == 'true' }}
needs:
- changes
scratch-render:
uses: ./.github/workflows/workspace-scratch-render.yml
if: ${{ !failure() && !cancelled() && needs.changes.outputs.scratch-render == 'true' }}
needs:
- changes
- scratch-storage
- scratch-svg-renderer
scratch-sb1-converter:
uses: ./.github/workflows/workspace-scratch-sb1-converter.yml
if: ${{ !failure() && !cancelled() && needs.changes.outputs.scratch-sb1-converter == 'true' }}
needs:
- changes
scratch-storage:
uses: ./.github/workflows/workspace-scratch-storage.yml
if: ${{ !failure() && !cancelled() && needs.changes.outputs.scratch-storage == 'true' }}
needs:
- changes
scratch-vm:
uses: ./.github/workflows/workspace-scratch-vm.yml
if: ${{ !failure() && !cancelled() && needs.changes.outputs.scratch-vm == 'true' }}
needs:
- changes
- scratch-sb1-converter
scratch-gui:
uses: ./.github/workflows/workspace-scratch-gui.yml
if: ${{ !failure() && !cancelled() && needs.changes.outputs.scratch-gui == 'true' }}
needs:
- changes
- paper-js
- scratch-audio
- scratch-blocks
- scratch-paint
- scratch-render
- scratch-sb1-converter
- scratch-storage
- scratch-svg-renderer
- scratch-vm