4.0.0 #78
Workflow file for this run
This file contains hidden or 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 & Publish | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'pnpm' | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Lint | |
| run: pnpm run lint | |
| - name: Build Package | |
| run: pnpm run build | |
| - name: Run Tests | |
| run: pnpm run test -- --run | |
| - name: Run Tests with Coverage | |
| run: pnpm run test:coverage | |
| env: | |
| VITE_FIGMA_TOKEN: ${{ secrets.VITE_FIGMA_TOKEN }} | |
| VITE_FIGMA_FILE_KEY: ${{ secrets.VITE_FIGMA_FILE_KEY }} | |
| - name: Upload Coverage Report (GitHub Artifact) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: coverage/ | |
| - name: Upload to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage/lcov.info | |
| flags: unittests | |
| name: codecov-coverage | |
| fail_ci_if_error: true | |
| - name: Check Publint | |
| run: pnpm run check:publint | |
| - name: Check ATTW | |
| run: pnpm run check:attw | |
| - name: Check Size | |
| run: pnpm run check:size | |
| publish: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| needs: ci | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://registry.npmjs.org' | |
| scope: '@figma-vars' | |
| - name: Update npm | |
| run: npm install -g npm@latest | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build Package | |
| run: pnpm run build | |
| - name: Publish to NPM | |
| run: npm publish --access public --provenance |