Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2023-10 Minor updates. #54

Merged
merged 1 commit into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
29 changes: 29 additions & 0 deletions .github/workflows/core-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish @iwsio/json-csv-core to npmjs.com
on:
workflow_call:

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- run: |
git config user.name github-actions
git config user.email github-actions@github.com
npm config set tag-version-prefix '@iwsio/json-csv-core v'
git fetch
git pull origin main
npm version patch -w packages/json-csv-core -m "@iwsio/json-csv-core %s publish."
git push
git push --tags
- run: npm ci -w packages/json-csv-node -w packages/json-csv-core
- run: npm run build
- run: npm publish --access public -w packages/json-csv-core
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/core-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Test @iwsio/json-csv-core

on:
workflow_call:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 16.x, 18.x, 20.x]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js 20 (for build)
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
- run: npm ci -w packages/json-csv-node -w packages/json-csv-core
- run: npm run build
- name: Use Node.js ${{ matrix.node-version }} for test runtime
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: cd test-runner-core && npm i --omit=dev && npm test
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ jobs:
- run: |
git config user.name github-actions
git config user.email github-actions@github.com
npm version patch
npm config set tag-version-prefix 'json-csv v'
npm version patch --no-git-tag-version -m "json-csv %s publish."
git push
git push --tags
- run: npm publish --access public
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run legacy tests
name: Test json-csv (legacy)

on:
workflow_call:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: '18'
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- run: |
git config user.name github-actions
git config user.email github-actions@github.com
npm config set tag-version-prefix '@iwsio/json-csv-node v'
git fetch
git pull origin main
npm version patch -ws --include-workspace-root
npm version patch -w packages/json-csv-node --include-workspace-root -m "@iwsio/json-csv-node %s publish."
git add .
git commit -m "CI - package versions"
npm version from-git --allow-same-version
git commit -am 'CI version bump'
git push
git push --tags
- run: npm ci -w package
- run: npm run build -w package
- run: npm publish --access public -w package
- run: npm ci -w packages/json-csv-node -w packages/json-csv-core
- run: npm run build
- run: npm publish --access public -w packages/json-csv-node
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
18 changes: 9 additions & 9 deletions .github/workflows/test.yaml → .github/workflows/node-test.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Tests CI
name: Test @iwsio/json-csv-node

on:
workflow_call:
Expand All @@ -16,13 +16,13 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js 18 (for build)
- name: Use Node.js 20 (for build)
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: 'npm'
- run: npm ci -w package
- run: npm run build -w package
- run: npm ci -w packages/json-csv-node -w packages/json-csv-core
- run: npm run build
- name: Use Node.js ${{ matrix.node-version }} for test runtime
uses: actions/setup-node@v3
with:
Expand All @@ -38,13 +38,13 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js 18 (for build)
- name: Use Node.js 20 (for build)
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: 'npm'
- run: npm ci -w package
- run: npm run build -w package
- run: npm ci -w packages/json-csv-node -w packages/json-csv-core
- run: npm run build
- name: Use Node.js ${{ matrix.node-version }} for test runtime
uses: actions/setup-node@v3
with:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/pr-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: "PR to main - @iwsio/json-csv-core"

on:
pull_request:
branches: [ main ]
paths:
- 'packages/json-csv-core/**'
jobs:
test:
if: ${{ !contains(github.event.head_commit.message, '#skip') }}
uses: ./.github/workflows/core-test.yaml
4 changes: 2 additions & 2 deletions .github/workflows/pr-json-csv.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Changes to main
name: PR to json-csv (legacy)

on:
pull_request:
Expand All @@ -10,4 +10,4 @@ on:
jobs:
test:
if: ${{ !contains(github.event.head_commit.message, '#skip') }}
uses: ./.github/workflows/test-legacy.yaml
uses: ./.github/workflows/legacy-test.yaml
10 changes: 0 additions & 10 deletions .github/workflows/pr-main.yml

This file was deleted.

11 changes: 11 additions & 0 deletions .github/workflows/pr-node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: "PR to main - @iwsio/json-csv-node"

on:
pull_request:
branches: [ main ]
paths:
- 'packages/json-csv-node/**'
jobs:
test:
if: ${{ !contains(github.event.head_commit.message, '#skip') }}
uses: ./.github/workflows/node-test.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: Push to main
name: Push to main - @iwsio/json-csv-core

on:
push:
branches: [ main ]
paths:
- 'packages/json-csv-core/**'

jobs:
test:
if: ${{ !contains(github.event.head_commit.message, '#skip') }}
uses: ./.github/workflows/test.yaml
uses: ./.github/workflows/core-test.yaml
version-and-publish:
needs: test
if: ${{ !contains(github.event.head_commit.message, '#skip') }}
uses: ./.github/workflows/publish.yaml
uses: ./.github/workflows/core-publish.yaml
secrets: inherit
6 changes: 3 additions & 3 deletions .github/workflows/push-json-csv.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Push to main
name: Push to json-csv (legacy)

on:
push:
Expand All @@ -7,9 +7,9 @@ on:
jobs:
test:
if: ${{ !contains(github.event.head_commit.message, '#skip') }}
uses: ./.github/workflows/test-legacy.yaml
uses: ./.github/workflows/legacy-test.yaml
version-and-publish:
needs: test
if: ${{ !contains(github.event.head_commit.message, '#skip') }}
uses: ./.github/workflows/publish-legacy.yaml
uses: ./.github/workflows/legacy-publish.yaml
secrets: inherit
17 changes: 17 additions & 0 deletions .github/workflows/push-node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Push to main - @iwsio/json-csv-node

on:
push:
branches: [ main ]
paths:
- 'packages/json-csv-node/**'

jobs:
test:
if: ${{ !contains(github.event.head_commit.message, '#skip') }}
uses: ./.github/workflows/node-test.yaml
version-and-publish:
needs: test
if: ${{ !contains(github.event.head_commit.message, '#skip') }}
uses: ./.github/workflows/node-publish.yaml
secrets: inherit
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
20
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
# @iwsio/json-csv-node
# @iwsio/json-csv-core

[![Push to main](https://github.com/iwsllc/json-csv/actions/workflows/push-main.yml/badge.svg?branch=main)](https://github.com/iwsllc/json-csv/actions/workflows/push-main.yml)

For more information on [json-csv-node itself, checkout the readme](./package/README.md).
Checkout the readme for [more information on json-csv-node](./packages/json-csv-node/README.md).
Checkout the readme for [more information on json-csv-core](./packages/json-csv-core/README.md).

## Dev Setup
Here's how to setup and run the samples locally.

```bash
# install everything for all workspaces (Recommended: Node 18)
# install everything for all workspaces (Recommended: Node 20)
npm i

# build the library
# build the packages
npm run build

# run the samples individually
Expand Down
18 changes: 18 additions & 0 deletions eslint-base-node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": [
"./eslint-base.json",
"plugin:node/recommended"
],

"plugins": [
"node"
],

"rules": {
"node/no-missing-import": "off",
"node/no-unsupported-features/es-syntax": "off",
"node/no-extraneous-import": ["error", {
"allowModules": ["@iwsio/json-csv-core", "@iwsio/json-csv-node"]
}]
}
}
Loading