Skip to content

Commit

Permalink
Merge pull request #3 from zhz0704/workflow
Browse files Browse the repository at this point in the history
Add workflows and fix spelling
  • Loading branch information
dubiety authored Aug 29, 2024
2 parents 2ff0f43 + cd22953 commit f9603b8
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 2 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci --force
- run: npm run build --if-present
35 changes: 35 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Publish Node.js Package

on:
release:
types: [published]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci --force
- run: npm run build --if-present

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm ci --force
- run: npm run build --if-present --isNpmBuild
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
2 changes: 1 addition & 1 deletion build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ let rollupError = false;

// Read license.txt to define the banner for the packages.
let banner = "/*\n";
banner += (await fs.readFile("./license.md", "utf8")).trim();
banner += (await fs.readFile("./LICENSE.md", "utf8")).trim();
banner += "\n*/\n";

let rollupInputOps, rollupOutputOps;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"files": [
"typings/**/*",
"dist/**/*",
"license.md"
"LICENSE.md"
],
"types": "typings/index.d.ts",
"main": "dist/azure-maps-gridded-data-source.min.js"
Expand Down

0 comments on commit f9603b8

Please sign in to comment.