-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
118 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
name: Unit Tests | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
tags: | ||
# normal versions | ||
- "v?[0-9]+.[0-9]+.[0-9]+" | ||
# pre-releases | ||
- "v?[0-9]+.[0-9]+.[0-9]+-**" | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build-and-test: | ||
if: contains(github.event.head_commit.message, '[skip ci]') == false | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [8.x, 10.x, 12.x, 14.x, 16.x, 18.x, 20.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Cache dependencies | ||
if: ${{ !env.ACT }} | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./node_modules | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Install dependencies | ||
run: npm ci --ignore-scripts | ||
|
||
- name: Install winston@3 peer dependency | ||
run: npm install --no-save winston@3 | ||
|
||
- run: npm test | ||
|
||
# Deploys the final package to NPM | ||
deploy: | ||
needs: [build-and-test] | ||
|
||
# Trigger this step only when a commit on master is tagged with a version number | ||
if: | | ||
contains(github.event.head_commit.message, '[skip ci]') == false && | ||
github.event_name == 'push' && | ||
startsWith(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Extract the version and commit body from the tag | ||
id: extract_release | ||
# The body may be multiline, therefore we need to escape some characters | ||
run: | | ||
VERSION="${{ github.ref }}" | ||
VERSION=${VERSION##*/} | ||
VERSION=${VERSION##*v} | ||
echo "::set-output name=VERSION::$VERSION" | ||
BODY=$(git show -s --format=%b) | ||
BODY="${BODY//'%'/'%25'}" | ||
BODY="${BODY//$'\n'/'%0A'}" | ||
BODY="${BODY//$'\r'/'%0D'}" | ||
echo "::set-output name=BODY::$BODY" | ||
- name: Install Dependencies | ||
run: npm ci --ignore-scripts | ||
|
||
# - name: Create a clean build | ||
# run: npm run build | ||
- name: Publish package to npm | ||
run: | | ||
npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} | ||
npm whoami | ||
npm publish | ||
- name: Create Github Release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release v${{ steps.extract_release.outputs.VERSION }} | ||
draft: false | ||
# Prerelease versions create prereleases on Github | ||
prerelease: ${{ contains(steps.extract_release.outputs.VERSION, '-') }} | ||
body: ${{ steps.extract_release.outputs.BODY }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"plugins": ["license"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Changelog | ||
<!-- | ||
Placeholder for the next version (at the beginning of the line): | ||
## **WORK IN PROGRESS** | ||
--> | ||
## **WORK IN PROGRESS** | ||
* Converted partially to ES6 | ||
* Emit "error" event on lwo level filesystem errors to allow logging and handling of them |