From e7c359ebfdfbad4fe909ab948dca23336c002273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20=C5=BBuraw?= <9116238+krzysztofzuraw@users.noreply.github.com> Date: Fri, 1 Mar 2024 11:45:37 +0100 Subject: [PATCH] changes after CR --- .github/workflows/dev-release.yml | 2 +- .github/workflows/main.yml | 28 +++++++++++++++++++++++++-- .github/workflows/prepare-release.yml | 5 +---- .husky/pre-push | 2 +- package.json | 6 ++++-- 5 files changed, 33 insertions(+), 10 deletions(-) diff --git a/.github/workflows/dev-release.yml b/.github/workflows/dev-release.yml index 0ad4d233..3beb648d 100644 --- a/.github/workflows/dev-release.yml +++ b/.github/workflows/dev-release.yml @@ -28,7 +28,7 @@ jobs: env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Release on @dev tag in npm - run: pnpm exec changeset version --snapshot pr && pnpm publish --tag dev --no-git-checks + run: pnpm publish:ci-dev - name: Get new package version run: | VERSION=$(cat package.json | jq -r '.version') diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cebe1574..5ed39ce3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,7 @@ name: QA on: [pull_request] jobs: - lint-test: + lint: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -12,7 +12,19 @@ jobs: - args: [--frozen-lockfile] - name: Check linters run: pnpm lint - - name: Test + - name: Check types + run: pnpm check-types + + test: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Setup PNPM + uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 + with: + run_install: | + - args: [--frozen-lockfile] + - name: Run tests run: pnpm test:ci - name: Generate coverage report uses: irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 # v1.3.0 @@ -27,3 +39,15 @@ jobs: with: recreate: true path: code-coverage-results.md + + build: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Setup PNPM + uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 + with: + run_install: | + - args: [--frozen-lockfile] + - name: Build package + run: pnpm build diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index bcc4b426..c90c831e 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -13,8 +13,6 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - with: - token: ${{ secrets.PAT }} - name: Setup PNPM uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 with: @@ -27,6 +25,5 @@ jobs: commit: Release to npm publish: "pnpm publish:ci" env: - # Use private access token so Github can trigger another workflow from this one - GITHUB_TOKEN: ${{ secrets.PAT }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.husky/pre-push b/.husky/pre-push index 45ac5307..31fc1f98 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,4 +1,4 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -pnpm run test:ci +pnpm check-types && pnpm test:ci diff --git a/package.json b/package.json index 166a64a0..9b49670f 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,11 @@ "test": "vitest", "test:ci": "CI=true vitest --coverage --silent", "prepare": "husky install", - "lint": "tsc --noEmit && prettier --loglevel warn --write . && eslint --fix .", + "check-types": "tsc --noEmit", + "lint": "prettier --loglevel warn --write . && eslint --fix .", "copy-readme": "cp README.md dist/README.md", - "publish:ci": "pnpm publish --dry-run && pnpm exec changeset tag && git push --follow-tags", + "publish:ci-prod": "pnpm publish --dry-run", + "publish:ci-dev": "pnpm publish --dry-run --tag dev", "lint-staged": "lint-staged" }, "keywords": [],