diff --git a/.github/actions/publish-types/action.yml b/.github/actions/publish-types/action.yml index 10c98a7..bbda757 100644 --- a/.github/actions/publish-types/action.yml +++ b/.github/actions/publish-types/action.yml @@ -3,9 +3,6 @@ inputs: VERSION: description: Packages version required: true - NODE_AUTH_TOKEN: - description: Node auth token - required: true runs: using: composite steps: @@ -29,20 +26,19 @@ runs: jq --arg version "${{ inputs.VERSION }}" '.dependencies."@dop251/types-goja_nodejs-global" = $version' $pkg/types/package.json > $pkg/types/tmp.json && mv $pkg/types/tmp.json $pkg/types/package.json done - name: Setup nodejs - uses: actions/setup-node@v2 + uses: actions/setup-node@v6 with: node-version: '22' registry-url: 'https://registry.npmjs.org' - name: Publish the packages shell: bash run: | + npm install -g npm@11.5.1 cd global-types - npm publish --access=public + npm publish ---tag latest --access=public cd - for pkg in ${{ steps.vars.outputs.PKGS }}; do cd $pkg/types - npm publish --access=public + npm publish --tag latest --access=public cd - done - env: - NODE_AUTH_TOKEN: ${{ inputs.NODE_AUTH_TOKEN }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 701f305..ec38028 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,5 +1,10 @@ on: [push, pull_request] name: Test + +permissions: + id-token: write # Required for OIDC + contents: read + jobs: test: strategy: @@ -60,7 +65,6 @@ jobs: if: env.version != '' with: VERSION: ${{ env.version }} - NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} publish-types-untagged: name: 'Publish type definitions to npm (untagged master)' @@ -76,4 +80,3 @@ jobs: - uses: './.github/actions/publish-types' with: VERSION: ${{ env.version }} - NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}