From c1dfacdcd462e749481e00d109e90ddd9eaafc2b Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Thu, 7 Dec 2023 17:14:26 +0100 Subject: [PATCH 1/3] Do not lint, but build in Test --- .github/workflows/{main.yml => test.yml} | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) rename .github/workflows/{main.yml => test.yml} (66%) diff --git a/.github/workflows/main.yml b/.github/workflows/test.yml similarity index 66% rename from .github/workflows/main.yml rename to .github/workflows/test.yml index 9015c94..895a576 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,5 @@ -name: Lint +name: Test + on: push: branches: @@ -7,22 +8,26 @@ on: branches: - main +env: + FORCE_COLOR: 2 + jobs: - lint: + test: runs-on: ubuntu-latest - env: - FORCE_COLOR: 2 steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v2 with: - version: latest + version: 8 - uses: actions/setup-node@v4 with: node-version: 20 cache: pnpm - name: Install dependencies run: pnpm install --ignore-scripts - - name: Lint - run: pnpm lint + # pre-commit dioes this for us + # - name: Lint + # run: pnpm run lint + - name: Build + run: pnpm run build From c35a7d5a81b2c4e8fe7af1e222709eb433a0a3dc Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Thu, 7 Dec 2023 17:15:54 +0100 Subject: [PATCH 2/3] Shorten Size Limit job --- .github/workflows/size.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml index 8f19941..7f2672a 100644 --- a/.github/workflows/size.yml +++ b/.github/workflows/size.yml @@ -1,4 +1,5 @@ name: Size Limit + on: pull_request: branches: @@ -15,16 +16,16 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Fetch Git refs + run: git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* - uses: pnpm/action-setup@v2 with: - version: latest + version: 8 - uses: actions/setup-node@v4 with: node-version: 20 cache: pnpm - - name: Install dependencies - run: pnpm install --ignore-scripts - - name: Check size + - name: Check package size uses: andresz1/size-limit-action@v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} From aaffdbf7dc68c5edb106b239dc75bb447feefa7b Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Thu, 7 Dec 2023 17:18:36 +0100 Subject: [PATCH 3/3] Add Publish job --- .github/workflows/publish.yml | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..7e20a97 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,36 @@ +name: Publish + +on: + release: + types: + - published + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + registry-url: "https://registry.npmjs.org" + cache: pnpm + - name: Install dependencies + run: pnpm install --ignore-scripts + - name: Build + run: pnpm run build + - name: Publish to NPM (with provenance) + run: pnpm publish --no-git-checks --access public --tag ${{ github.event.release.prerelease && 'next' || 'latest' }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NPM_CONFIG_PROVENANCE: "true"