diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ff5d0d..233c0a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,9 +3,6 @@ name: CI -permissions: - contents: write - pull-requests: write on: push: branches: @@ -22,9 +19,7 @@ jobs: strategy: matrix: - node-version: - - 20.x - - 22.x + node-version: [20, 22] steps: - uses: actions/checkout@v6 @@ -37,7 +32,7 @@ jobs: - run: npm test - run: npm run build --if-present - name: Save build - if: matrix.node-version == '20.x' + if: matrix.node-version == 20 uses: actions/upload-artifact@v6 with: name: build @@ -61,39 +56,47 @@ jobs: npm-publish-build: needs: build runs-on: ubuntu-latest + permissions: + id-token: write + contents: read steps: - uses: actions/download-artifact@v7 with: name: build - uses: actions/setup-node@v6 with: - node-version: 20.x + node-version: 20 + registry-url: 'https://registry.npmjs.org' + - name: Update npm to latest (required for OIDC) + run: npm install -g npm@latest - uses: rlespinasse/github-slug-action@v3.x - name: Append commit hash to package version run: 'sed -i -E "s/(\"version\": *\"[^\"]+)/\1-${GITHUB_SHA_SHORT}/" package.json' - name: Disable pre- and post-publish actions run: 'sed -i -E "s/\"((pre|post)publish)/\"ignore:\1/" package.json' - - uses: JS-DevTools/npm-publish@v4.1.4 + - name: Publish to npm if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' - with: - token: ${{ secrets.NPM_TOKEN }} - tag: ${{ env.GITHUB_REF_SLUG }} + run: npm publish --tag ${{ env.GITHUB_REF_SLUG }} npm-publish-latest: needs: [build, npm-publish-build] runs-on: ubuntu-latest if: github.ref == 'refs/heads/main' + permissions: + id-token: write # Required for OIDC + contents: read steps: - uses: actions/download-artifact@v7 with: name: build - uses: actions/setup-node@v6 with: - node-version: 20.x + node-version: 20 + registry-url: 'https://registry.npmjs.org' + - name: Update npm to latest (required for OIDC) + run: npm install -g npm@latest - name: Disable pre- and post-publish actions run: 'sed -i -E "s/\"((pre|post)publish)/\"ignore:\1/" package.json' - - uses: JS-DevTools/npm-publish@v4.1.4 + - name: Publish to npm if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' - with: - token: ${{ secrets.NPM_TOKEN }} - tag: latest + run: npm publish --tag latest diff --git a/package.json b/package.json index 8e69750..1dbe5d5 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/solid/source-pane.git" + "url": "git+https://github.com/SolidOS/source-pane.git" }, "keywords": [ "solid",