fix: explicitly import stylelint-order package #41
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 | |
| on: | |
| push: | |
| branches: | |
| - 'master' | |
| pull_request: | |
| branches: | |
| - '*' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| set-environment: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| outputs: | |
| environment: ${{ steps.set-environment.outputs.environment }} | |
| steps: | |
| - name: Set Environment | |
| id: set-environment | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const isPush = context.eventName === 'push' | |
| const isMain = context.ref === 'refs/heads/master' | |
| let environment = 'preview' | |
| if (isPush && isMain) { | |
| environment = 'production' | |
| } | |
| console.log(`Environment resolved to "${environment}".`) | |
| core.setOutput('environment', environment) | |
| checks: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| needs: [set-environment] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: Run tests | |
| command: test | |
| - name: Lint code | |
| command: check:lint | |
| - name: Check types | |
| command: check:types | |
| - name: Check formatting | |
| command: check:format | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 'lts/*' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: | | |
| pnpm install --frozen-lockfile | |
| - name: ${{ matrix.name }} | |
| run: | | |
| pnpm run ${{ matrix.command }} | |
| build: | |
| needs: [set-environment, checks] | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| if: ${{ needs.set-environment.outputs.environment == 'production' }} | |
| environment: | |
| name: ${{ needs.set-environment.outputs.environment }} | |
| outputs: | |
| artifact-name: ${{ steps.set-artifact-name.outputs.artifact-name }} | |
| build-output-pathname: ${{ steps.set-build-output-pathname.outputs.build-output-pathname }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Set up Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 'lts/*' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: | | |
| pnpm install --frozen-lockfile | |
| - name: Set artifact name | |
| id: set-artifact-name | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const shortSha = context.sha.substring(0, 7) | |
| const artifactName = `build-${shortSha}` | |
| core.setOutput('artifact-name', artifactName) | |
| - name: Build | |
| run: | | |
| pnpm run build | |
| - name: Set build output pathname | |
| id: set-build-output-pathname | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const buildOutputPathname = 'dist' | |
| core.setOutput('build-output-pathname', buildOutputPathname) | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ steps.set-artifact-name.outputs.artifact-name }} | |
| path: ${{ github.workspace }}/${{ steps.set-build-output-pathname.outputs.build-output-pathname }}/ | |
| release: | |
| needs: [set-environment, checks, build] | |
| runs-on: ubuntu-latest | |
| if: ${{ needs.set-environment.outputs.environment == 'production' }} | |
| environment: | |
| name: ${{ needs.set-environment.outputs.environment }} | |
| permissions: | |
| id-token: write # To enable use of OIDC for npm provenance. | |
| contents: write # To be able to publish a GitHub release. | |
| issues: write # To be able to comment on released issues. | |
| pull-requests: write # To be able to comment on released pull requests. | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ssh-key: '${{ secrets.DEPLOY_KEY }}' | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Set up Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 'lts/*' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: | | |
| pnpm install --frozen-lockfile | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ needs.build.outputs.artifact-name }} | |
| path: ${{ github.workspace }}/${{ needs.build.outputs.build-output-pathname }} | |
| - name: Update npm | |
| run: | | |
| npm install --global npm@latest | |
| - name: Verify npm package signatures | |
| run: | | |
| npm audit signatures | |
| - name: Create a release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GIT_AUTHOR_NAME: 'github-actions[bot]' | |
| GIT_COMMITTER_NAME: 'github-actions[bot]' | |
| GIT_AUTHOR_EMAIL: '41898282+github-actions[bot]@users.noreply.github.com' | |
| GIT_COMMITTER_EMAIL: '41898282+github-actions[bot]@users.noreply.github.com' | |
| run: | | |
| pnpm exec -- semantic-release --repository-url "git@github.com:${{ github.repository }}.git" |