From e6ec10cdd796d42fbf46c10be235c877b81f72f3 Mon Sep 17 00:00:00 2001 From: divdavem Date: Fri, 8 Dec 2023 14:56:53 +0100 Subject: [PATCH] chore: update github actions (#116) --- .github/workflows/ci.yml | 11 +++-------- .github/workflows/release.yml | 19 +++++++++++-------- .github/workflows/update.yml | 4 ++-- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68800ba..1cc0c45 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,15 +9,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: '18.x' - - uses: actions/cache@v3 - with: - path: .yarn/cache - key: yarn-${{ hashFiles('yarn.lock') }} - restore-keys: | - yarn- + cache: yarn + node-version: '20.x' - run: yarn --immutable - run: yarn lint - run: yarn format:check diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 41f6675..9278857 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,11 +10,16 @@ on: jobs: release: runs-on: ubuntu-latest + permissions: + id-token: write + contents: write steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: '18.x' + node-version: '20.x' + cache: yarn + registry-url: 'https://registry.npmjs.org' - run: yarn --immutable - name: npm version working-directory: src @@ -28,14 +33,12 @@ jobs: - run: git show HEAD - run: yarn build - run: yarn docs - - name: npm login - run: | - echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc + - run: | npm whoami - - run: npm publish --access=public + npm publish --access=public --provenance working-directory: dist/package - - name: npm logout - run: rm ~/.npmrc + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: git push origin master v${{ inputs.version }} - uses: actions/checkout@v4 with: diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index fb6f71c..7ee6fdc 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -11,9 +11,9 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set Node.js version - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: '18.x' + node-version: '20.x' - run: yarn set version stable - run: yarn install --no-immutable - run: yarn up --caret '**'