Skip to content

Commit

Permalink
Modify the GitHub Actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
seijikohara committed Sep 22, 2023
1 parent ca18667 commit b0acb76
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/npm-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Node.js CI

on: push

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
22 changes: 4 additions & 18 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Node.js Package
name: Node.js Publish package

on:
push:
Expand All @@ -11,26 +8,15 @@ on:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
# - run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

0 comments on commit b0acb76

Please sign in to comment.