Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
feat: restructure build packages
Browse files Browse the repository at this point in the history
BREAKING CHANGE: there are no es6, esnext and amd for the package anymore. The release package will have cjs, es and types folders instead.
  • Loading branch information
hckhanh committed Apr 2, 2021
1 parent 452f349 commit c426a9d
Show file tree
Hide file tree
Showing 12 changed files with 12,143 additions and 1,991 deletions.
4 changes: 3 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
dist
cjs
es
types
tests
5 changes: 2 additions & 3 deletions .github/workflows/gpr-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ jobs:
- name: Build commonjs, es6, esnext and amd
run: |
npm run build:cjs
npm run build:es6
npm run build:esnext
npm run build:amd
npm run build:es
npm run build:types
- name: Publish to gpr
run: npm publish
env:
Expand Down
49 changes: 40 additions & 9 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,57 @@
name: Publish NPM Package

on:
release:
types: [published]
push:
branches: [master]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/setup-node@v2.1.4
with:
check-latest: true
- name: Dependency check
run: npm ci
- name: Dependency cruiser check
run: npm run test:deps
- name: Prettier check
run: npm run test:prettier
- name: ESLint check
run: npm run test:eslint
- name: Skypack check
run: npm run test:skypack
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [12, 13, 14, 15]
steps:
- uses: actions/checkout@v2.3.4
- name: Set up Node.js ${{matrix.node}}
uses: actions/setup-node@v2.1.4
with:
node-version: ${{matrix.node}}
- name: Unit tests
run: npm cit
publish-npm:
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/setup-node@v2.1.4
with:
node-version: 12
check-latest: true
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm ci
- name: Build commonjs, es6, esnext and amd
run: |
npm run build:cjs
npm run build:es6
npm run build:esnext
npm run build:amd
npm run build:es
npm run build:types
- name: Publish to npm
run: npm publish
run: npm run release
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
11 changes: 4 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Unit Tests
name: Tests

on:
pull_request:
Expand All @@ -10,10 +10,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- name: Use Node.js ${{matrix.node}}
uses: actions/setup-node@v2.1.4
- uses: actions/setup-node@v2.1.4
with:
node-version: 12
check-latest: true
- name: Dependency check
run: npm ci
Expand All @@ -30,10 +28,10 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [12, 13, 14]
node: [12, 13, 14, 15]
steps:
- uses: actions/checkout@v2.3.4
- name: Use Node.js ${{matrix.node}}
- name: Set up Node.js ${{matrix.node}}
uses: actions/setup-node@v2.1.4
with:
node-version: ${{matrix.node}}
Expand All @@ -47,7 +45,6 @@ jobs:
- name: Use Node.js 12
uses: actions/setup-node@v2.1.4
with:
node-version: 12
check-latest: true
- name: Download CodeClimade Test Reporter
run: |
Expand Down
16 changes: 14 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,25 @@ node_modules/
.eslintcache

# builds
dist
cjs
es
types

# JetBrains IDEs
# Editors
.idea
.vscode

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# yarn 2 (Zero-Installs)
.yarn/*
!.yarn/cache
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
5 changes: 4 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
coverage
dist
cjs
es
types
.nyc_output
CHANGELOG.md
/tsconfig.json
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changelog

## Note: From `v4.0.0`, please go to [releases](https://github.com/hckhanh/read-vn-number/releases) page to get information.

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [3.2.1](https://github.com/hckhanh/read-vn-number/compare/v3.1.0...v3.2.1) (2020-10-24)
Expand Down
Loading

0 comments on commit c426a9d

Please sign in to comment.