-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add github action for release
- Loading branch information
1 parent
304a238
commit c48f145
Showing
4 changed files
with
137 additions
and
10 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,121 @@ | ||
name: Release - cli | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
schedule: | ||
# 08:00am UTC everyday: https://crontab.guru/#0_8_*_*_* | ||
# https://dateful.com/convert/utc?t=8am | ||
- cron: "0 8 * * *" | ||
|
||
jobs: | ||
lint-all: | ||
if: | | ||
github.event_name == 'schedule' || | ||
github.event_name == 'workflow_dispatch' || | ||
startsWith(github.head_ref, 'release/') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js 16.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
cache: npm | ||
- run: node bin/npm-cli.js run resetdeps | ||
- run: node bin/npm-cli.js run lint-all | ||
|
||
smoke-publish: | ||
if: | | ||
github.event_name == 'schedule' || | ||
github.event_name == 'workflow_dispatch' || | ||
startsWith(github.head_ref, 'release/') | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node-version: | ||
- 12.13.0 | ||
- 12.x | ||
- 14.15.0 | ||
- 14.x | ||
- 16.0.0 | ||
- 16.x | ||
platform: | ||
- os: ubuntu-latest | ||
shell: bash | ||
- os: macos-latest | ||
shell: bash | ||
- os: windows-latest | ||
shell: cmd | ||
runs-on: ${{ matrix.platform.os }} | ||
defaults: | ||
run: | ||
shell: ${{ matrix.platform.shell }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js 16.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
cache: npm | ||
- name: Pack | ||
run: | | ||
node bin/npm-cli.js run resetdeps | ||
git clean -fd | ||
node bin/npm-cli.js ls --production | ||
node bin/npm-cli.js link -f --ignore-scripts | ||
node bin/npm-cli.js prune --production --no-save --no-audit --no-fund | ||
node bin/npm-cli.js pack | ||
- if: matrix.platform.os == 'windows-latest' | ||
run: for %%i in (*.tgz) DO tar xf %%i | ||
- if: matrix.platform.os != 'windows-latest' | ||
run: tar xf npm-*.tgz | ||
- name: Run smoke tests | ||
env: | ||
SMOKE_TEST_NPM_PACKAGE: package | ||
run: | | ||
node bin/npm-cli.js run resetdeps | ||
node bin/npm-cli.js run smoke-tests | ||
- name: git status | ||
if: matrix.platform.os != 'windows-latest' | ||
run: node scripts/git-dirty.js | ||
|
||
test-all: | ||
if: | | ||
github.event_name == 'schedule' || | ||
github.event_name == 'workflow_dispatch' || | ||
startsWith(github.head_ref, 'release/') | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node-version: | ||
- 12.13.0 | ||
- 12.x | ||
- 14.15.0 | ||
- 14.x | ||
- 16.0.0 | ||
- 16.x | ||
platform: | ||
- os: ubuntu-latest | ||
shell: bash | ||
- os: macos-latest | ||
shell: bash | ||
- os: windows-latest | ||
shell: cmd | ||
runs-on: ${{ matrix.platform.os }} | ||
defaults: | ||
run: | ||
shell: ${{ matrix.platform.shell }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: npm | ||
- run: node bin/npm-cli.js run resetdeps | ||
- run: node bin/npm-cli.js link -f --ignore-scripts | ||
- run: node bin/npm-cli.js run test-all --ignore-scripts | ||
- name: git status | ||
if: matrix.platform.os != 'windows-latest' | ||
run: node scripts/git-dirty.js |
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
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
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