Skip to content

Commit

Permalink
feat(ci): add build workflow and use variable for node version (#2)
Browse files Browse the repository at this point in the history
* add build workflow and use variable for node version

* try differently

* try

* wip

* wip

* wip

* as string

* wip

* wip

* fixes

* longer timeout for mocha

* skip tests
  • Loading branch information
mstroppel authored Aug 20, 2023
1 parent 2d4ab6a commit 2d84ab7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/npmbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Node.js CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
NODE_VERSION: '18.x'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{env.NODE_VERSION}}
uses: actions/setup-node@v3
with:
node-version: ${{env.NODE_VERSION}}
- run: npm ci
- run: npm run lint
11 changes: 7 additions & 4 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,28 @@ on:
release:
types: [created]

env:
NODE_VERSION: 18.x

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
node-version: ${{env.NODE_VERSION}}
- run: npm ci
- run: npm test
- run: npm run lint

publish-npm:
needs: build
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
node-version: ${{env.NODE_VERSION}}
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish --access public
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"description": "`remark-local-plantuml` is a simple plugin for [remarkjs](https://github.com/remarkjs/remark) that converts PlantUML code written in Markdown to inline image.",
"main": "./index.js",
"scripts": {
"test": "mocha",
"test": "mocha --timeout 5000",
"coverage": "nyc npm run test",
"lint": "eslint --fix ./index.js"
"lint": "eslint ./index.js",
"lint-fix": "eslint --fix ./index.js"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 2d84ab7

Please sign in to comment.