Skip to content

Commit

Permalink
ci: set up npm publish workflow (#121)
Browse files Browse the repository at this point in the history
* test(npm): dry run npm publish workflow

* fix(test): checkout repo

* ci(npm): add `JS-DevTools/npm-publish` GHA

* build: bump version
  • Loading branch information
ayushmanchhabra committed Oct 26, 2023
1 parent fc3c0ef commit 8abc647
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 6 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/cd.yml
@@ -0,0 +1,22 @@
name: cd

on:
push:
branches: [ master ]

jobs:
npm:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1
- name: Publish sdk tag to npm
uses: JS-DevTools/npm-publish@v3.0.1
with:
token: ${{ secrets.NPM_TOKEN }}
tag: sdk
- name: Publish latest tag to npm
uses: JS-DevTools/npm-publish@v3.0.1
with:
token: ${{ secrets.NPM_TOKEN }}
tag: latest
27 changes: 24 additions & 3 deletions .github/workflows/ci.yml
Expand Up @@ -4,16 +4,20 @@ on:
pull_request:
branches: [ master ]

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
test:
e2e:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3.3.0
uses: actions/checkout@v4.1.1
- name: Get Node version from Node manifest
run: echo "NODE_VER=$(curl -s https://nwjs.io/versions | jq -r ".versions[0].components.node")" >> $GITHUB_ENV
- name: Setup Node
uses: actions/setup-node@v3.6.0
uses: actions/setup-node@v4.0.0
with:
node-version: ${{ env.NODE_VER }}
cache: "npm"
Expand All @@ -23,3 +27,20 @@ jobs:
run: npm ci
- name: Run test
run: npm test
npm:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1
- name: Test publish sdk tag to npm
uses: JS-DevTools/npm-publish@v3.0.1
with:
token: ${{ secrets.NPM_TOKEN }}
tag: sdk
dry-run: true
- name: Test publish latest tag to npm
uses: JS-DevTools/npm-publish@v3.0.1
with:
token: ${{ secrets.NPM_TOKEN }}
tag: latest
dry-run: true
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "nw",
"version": "0.80.0",
"version": "0.81.0",
"description": "A installer for nw.js",
"repository": {
"type": "git",
Expand Down

0 comments on commit 8abc647

Please sign in to comment.