From c6a7650bf898e3d9844558d93486801e30bcfeef Mon Sep 17 00:00:00 2001 From: Adilson Carvalho Date: Thu, 7 Jan 2021 22:09:13 +1100 Subject: [PATCH] Another try fixing the publishing (#31) * Avoid removing the previous contents * Try to publish from this branch to test * Where are my files? * It seems it must be a single job * Not using npm ci * The token configuration seems to be wrong * Releasing 0.1.3 * Publising requires creating a .npmrc file * Releasing 0.1.5 * Back to publishing only release tags * Releasing 0.1.6 --- .github/workflows/publish.yml | 19 +++++-------------- .gitignore | 1 + package.json | 2 +- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 03ac427..df4059d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,7 +6,7 @@ on: - v* jobs: - build: + build-and-publish: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -22,20 +22,11 @@ jobs: - run: yarn install - run: yarn test - run: yarn build - - publish-npm: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: 12.x - registry-url: https://registry.npmjs.org/ - name: Changes package from private to public run: | sed -i -e 's/"private":\s*true/"private": false/g' dist/package.json - - run: npm ci - - run: npm publish dist/ --access public + - run: | + echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc + npm publish dist/ --access public env: - NODE_AUTH_TOKEN: ${{secrets.npm_token}} + NPM_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/.gitignore b/.gitignore index 4c84260..24bc1ed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ dist +.npmrc # Created by https://www.gitignore.io/api/node,macos,sublimetext,visualstudiocode diff --git a/package.json b/package.json index 1460644..42792f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@benvgroup/logger", - "version": "0.1.2", + "version": "0.1.6", "description": "Simple @google-cloud/logging wrapper using winston", "main": "lib/logger", "repository": "git@github.com:benvgroup/logger.git",