Skip to content

Commit

Permalink
chore: add in js publishing workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziinc committed Oct 7, 2023
1 parent ca8b0f5 commit 0eb734d
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/js-publish-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish dev package

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: build
uses: actions/setup-node@v1
with:
node-version: "18.x"
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 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)
env:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/js-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish to npm registry (manual)

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: build
uses: actions/setup-node@v1
with:
node-version: "18.x"
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 pack --dry-run
- name: Publish production package to npm
run: yarn publish --access public --tag latest --new-version $(npm run --silent vsn)
env:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

0 comments on commit 0eb734d

Please sign in to comment.