Skip to content

Commit

Permalink
Another try fixing the publishing (#31)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
adilsoncarvalho authored Jan 7, 2021
1 parent d3924c1 commit c6a7650
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
19 changes: 5 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- v*

jobs:
build:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -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}}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
dist
.npmrc

# Created by https://www.gitignore.io/api/node,macos,sublimetext,visualstudiocode

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": "[email protected]:benvgroup/logger.git",
Expand Down

0 comments on commit c6a7650

Please sign in to comment.