From bfd4f46a17b5147df19e59807672a26e9bf4c712 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Thu, 27 Jun 2024 12:01:52 +0200 Subject: [PATCH] ci: enable nightly channel --- .github/workflows/ci.yml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4eba0eaf..e11e7488 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,9 @@ on: - main - v1 +permissions: + id-token: write + jobs: ci: runs-on: ${{ matrix.os }} @@ -22,21 +25,32 @@ jobs: steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - run: corepack enable - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} cache: "pnpm" - uses: oven-sh/setup-bun@v2 - if: ${{ matrix.os != 'windows-latest' && matrix.node == 20 }} + if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == 20 }} with: bun-version: latest - run: pnpm install - run: pnpm lint - if: ${{ matrix.os != 'windows-latest' && matrix.node == 20 }} + if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == 20 }} - run: pnpm build - run: pnpm vitest run --coverage - run: pnpm test:bun --coverage - if: ${{ matrix.os != 'windows-latest' && matrix.node == 20 }} - # - name: Coverage - # uses: codecov/codecov-action@v1 + if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == 20 }} + - name: nightly release + if: | + github.event_name == 'push' && + !contains(github.event.head_commit.message, '[skip-release]') && + !startsWith(github.event.head_commit.message, 'docs') + run: | + echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc && + pnpm changelogen --canary nightly --publish + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + NPM_CONFIG_PROVENANCE: true