Skip to content

Registry path does not change #181

Closed
@qWici

Description

@qWici

I'm try to setup action for publish package to multiple registries - NPM and Github. But I got an error because npm registry does not change.
In logs I see the command to set registry done, but it does not changed:

Run npm config set //registry.npmjs.org/:_authToken $NPM_AUTH_TOKEN
registry = "https://npm.pkg.github.com/qwici"

Action

name: Publish to NPMJS and GPR

on:
  push:
    branches:
      - master

jobs:
  publish-to-npm-and-gpr:
    runs-on: ubuntu-latest
    steps:
      # Checkout the repo
      - uses: actions/checkout@master

      # Update package version and set up git
      - uses: actions/setup-node@master
      - name: Update package version and setup git
        run: |
          git config user.name "Vania Kucher"
          git config user.email dev.kucher@gmail.com
          npm version 1.0.$(date +%s)

      # Publish to NPMJS
      - uses: actions/setup-node@master
        with:
          node-version: 12
          registry-url: 'https://registry.npmjs.org/'
      - name: Publish to NPMJS
        run: |
          npm config set //registry.npmjs.org/:_authToken $NPM_AUTH_TOKEN
          npm config set scope "qwici"
          npm config list
          npm publish --access public
        env:
          CI: true
          NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

      # Publish to GitHub Package Registry
      - uses: actions/setup-node@master
        with:
          node-version: 12
          registry-url: https://npm.pkg.github.com/
          scope: 'qwici'
      - name: Publish to GitHub Package Registry
        run: npm publish
        env:
          NODE_AUTH_TOKEN: ${{github.GHPKG_TOKEN}}

Failed job

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions