Merge branch 'v2' of github.com:RSamaium/CanvasEngine into v2 #27
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: CI | |
on: | |
push: | |
branches: | |
- "*" | |
paths-ignore: | |
- "docs/**" | |
pull_request: | |
branches: | |
- "*" | |
paths-ignore: | |
- "docs/**" | |
jobs: | |
tests: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
node-version: [20] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm install --no-frozen-lockfile | |
- name: Build | |
run: pnpm build | |
- name: Run Tests | |
run: pnpm test | |
deploy: | |
needs: tests | |
runs-on: ubuntu-22.04 | |
if: github.ref == 'refs/heads/v2' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm install --no-frozen-lockfile | |
- name: Build | |
run: pnpm build | |
- name: 📣 Create Release Pull Request or Publish to npm | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
title: "chore(release): version packages 🦋" | |
publish: pnpm publish:packages | |
version: pnpm version:packages | |
commit: "chore(release): version packages 🦋 [skip ci]" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Update Starter Package Versions | |
run: | | |
CORE_VERSION=$(jq -r '.version' packages/core/package.json) | |
jq --arg version "$CORE_VERSION" '.dependencies.canvasengine = $version | .devDependencies["@canvasengine/compiler"] = $version' starter/package.json > starter/package.tmp.json | |
mv starter/package.tmp.json starter/package.json | |
shell: bash | |
- name: Commit Changes | |
run: | | |
git add starter/package.json | |
git commit -m "chore(release): update starter package version to $CORE_VERSION" | |
git push | |
shell: bash |