Skip to content

Commit

Permalink
chore: use npm to publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziinc committed Oct 7, 2023
1 parent 0eb734d commit d42921f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/js-publish-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches:
- main

defaults:
run:
working-directory: ./logflare-js

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -17,12 +21,12 @@ jobs:
registry-url: "https://registry.npmjs.org"
- run: git config --global user.email "[email protected]"
- run: git config --global user.name "GitHub Action"
- run: yarn
- run: yarn test
- run: yarn build
- run: npm ci
- run: npm test
- run: npm run build
- run: npm pack --dry-run
- name: Publish dev package to npm
run: yarn publish --access public --tag dev --new-version $(npm run --silent vsn)-$(echo ${GITHUB_SHA} | cut -c1-8)
run: npm publish --access public --tag dev-$(echo ${GITHUB_SHA} | cut -c1-8)
env:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
13 changes: 9 additions & 4 deletions .github/workflows/js-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: Publish to npm registry (manual)
on:
workflow_dispatch:

defaults:
run:
working-directory: ./logflare-js


jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -15,12 +20,12 @@ jobs:
registry-url: "https://registry.npmjs.org"
- run: git config --global user.email "[email protected]"
- run: git config --global user.name "GitHub Action"
- run: yarn
- run: yarn test
- run: yarn build
- run: npm ci
- run: npm run test
- run: npm run build
- run: npm pack --dry-run
- name: Publish production package to npm
run: yarn publish --access public --tag latest --new-version $(npm run --silent vsn)
run: npm publish --access public --tag latest
env:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

0 comments on commit d42921f

Please sign in to comment.