|
| 1 | +name: Release - cli |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + pull_request: |
| 6 | + schedule: |
| 7 | + # 08:00am UTC everyday: https://crontab.guru/#0_8_*_*_* |
| 8 | + # https://dateful.com/convert/utc?t=8am |
| 9 | + - cron: "0 8 * * *" |
| 10 | + |
| 11 | +jobs: |
| 12 | + lint-all: |
| 13 | + if: | |
| 14 | + github.event_name == 'schedule' || |
| 15 | + github.event_name == 'workflow_dispatch' || |
| 16 | + startsWith(github.head_ref, 'release/') |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v3 |
| 20 | + - name: Use Node.js 16.x |
| 21 | + uses: actions/setup-node@v3 |
| 22 | + with: |
| 23 | + node-version: 16.x |
| 24 | + cache: npm |
| 25 | + - run: node bin/npm-cli.js run resetdeps |
| 26 | + - run: node bin/npm-cli.js run lint-all |
| 27 | + |
| 28 | + smoke-publish: |
| 29 | + if: | |
| 30 | + github.event_name == 'schedule' || |
| 31 | + github.event_name == 'workflow_dispatch' || |
| 32 | + startsWith(github.head_ref, 'release/') |
| 33 | + strategy: |
| 34 | + fail-fast: false |
| 35 | + matrix: |
| 36 | + node-version: |
| 37 | + - 12.13.0 |
| 38 | + - 12.x |
| 39 | + - 14.15.0 |
| 40 | + - 14.x |
| 41 | + - 16.0.0 |
| 42 | + - 16.x |
| 43 | + platform: |
| 44 | + - os: ubuntu-latest |
| 45 | + shell: bash |
| 46 | + - os: macos-latest |
| 47 | + shell: bash |
| 48 | + - os: windows-latest |
| 49 | + shell: cmd |
| 50 | + runs-on: ${{ matrix.platform.os }} |
| 51 | + defaults: |
| 52 | + run: |
| 53 | + shell: ${{ matrix.platform.shell }} |
| 54 | + steps: |
| 55 | + - uses: actions/checkout@v3 |
| 56 | + - name: Use Node.js 16.x |
| 57 | + uses: actions/setup-node@v3 |
| 58 | + with: |
| 59 | + node-version: 16.x |
| 60 | + cache: npm |
| 61 | + - name: Pack |
| 62 | + run: | |
| 63 | + node bin/npm-cli.js run resetdeps |
| 64 | + git clean -fd |
| 65 | + node bin/npm-cli.js ls --production |
| 66 | + node bin/npm-cli.js link -f --ignore-scripts |
| 67 | + node bin/npm-cli.js prune --production --no-save --no-audit --no-fund |
| 68 | + node bin/npm-cli.js pack |
| 69 | + - if: matrix.platform.os == 'windows-latest' |
| 70 | + run: for %%i in (*.tgz) DO tar xf %%i |
| 71 | + - if: matrix.platform.os != 'windows-latest' |
| 72 | + run: tar xf npm-*.tgz |
| 73 | + - name: Run smoke tests |
| 74 | + env: |
| 75 | + SMOKE_TEST_NPM_PACKAGE: package |
| 76 | + run: | |
| 77 | + node bin/npm-cli.js run resetdeps |
| 78 | + node bin/npm-cli.js run smoke-tests |
| 79 | + - name: git status |
| 80 | + if: matrix.platform.os != 'windows-latest' |
| 81 | + run: node scripts/git-dirty.js |
| 82 | + |
| 83 | + test-all: |
| 84 | + if: | |
| 85 | + github.event_name == 'schedule' || |
| 86 | + github.event_name == 'workflow_dispatch' || |
| 87 | + startsWith(github.head_ref, 'release/') |
| 88 | + strategy: |
| 89 | + fail-fast: false |
| 90 | + matrix: |
| 91 | + node-version: |
| 92 | + - 12.13.0 |
| 93 | + - 12.x |
| 94 | + - 14.15.0 |
| 95 | + - 14.x |
| 96 | + - 16.0.0 |
| 97 | + - 16.x |
| 98 | + platform: |
| 99 | + - os: ubuntu-latest |
| 100 | + shell: bash |
| 101 | + - os: macos-latest |
| 102 | + shell: bash |
| 103 | + - os: windows-latest |
| 104 | + shell: cmd |
| 105 | + runs-on: ${{ matrix.platform.os }} |
| 106 | + defaults: |
| 107 | + run: |
| 108 | + shell: ${{ matrix.platform.shell }} |
| 109 | + steps: |
| 110 | + - uses: actions/checkout@v3 |
| 111 | + - name: Use Node.js ${{ matrix.node-version }} |
| 112 | + uses: actions/setup-node@v3 |
| 113 | + with: |
| 114 | + node-version: ${{ matrix.node-version }} |
| 115 | + cache: npm |
| 116 | + - run: node bin/npm-cli.js run resetdeps |
| 117 | + - run: node bin/npm-cli.js link -f --ignore-scripts |
| 118 | + - run: node bin/npm-cli.js run test-all --ignore-scripts |
| 119 | + - name: git status |
| 120 | + if: matrix.platform.os != 'windows-latest' |
| 121 | + run: node scripts/git-dirty.js |
0 commit comments