From ec914f051b9dd73f52146c249f141cb470f37b86 Mon Sep 17 00:00:00 2001 From: d0nda Date: Sat, 21 Jun 2025 18:49:37 +0200 Subject: [PATCH] should work ?? --- .github/workflows/publish.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2091bc9..2613719 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,29 +12,25 @@ jobs: uses: actions/setup-node@v4 with: node-version: '20.x' + registry-url: 'https://registry.npmjs.org' - - name: Setup .npmrc with authentication + - name: Configure npm authentication run: | - npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }} - npm config set registry https://registry.npmjs.org/ - npm config set always-auth true - - - name: Debug - Check .npmrc content - run: | - echo "Contents of .npmrc:" - cat ~/.npmrc | sed 's/_authToken=.*/_authToken=***HIDDEN***/' - echo "NPM config:" - npm config list + npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN} + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Debug - Verify authentication run: | echo "Checking npm authentication:" npm whoami - echo "Checking package ownership:" - npm owner ls usagey + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Install dependencies run: npm ci + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Run tests run: npm test @@ -51,6 +47,8 @@ jobs: run: | PUBLISHED_VERSION=$(npm view usagey version 2>/dev/null || echo "0.0.0") echo "version=$PUBLISHED_VERSION" >> $GITHUB_OUTPUT + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Compare versions id: version_check @@ -68,6 +66,8 @@ jobs: echo "No version change - skipping publish" fi - - name: Publish to npm with explicit registry + - name: Publish to npm if: steps.version_check.outputs.should_publish == 'true' - run: npm publish --registry https://registry.npmjs.org/ --access public \ No newline at end of file + run: npm publish --access public + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file