diff options
author | Luke Karrys <luke@lukekarrys.com> | 2022-10-21 20:41:40 +0300 |
---|---|---|
committer | Gar <wraithgar@github.com> | 2022-11-01 20:19:36 +0300 |
commit | 9709ae60b780410526ab2117519eba6f97d5972c (patch) | |
tree | bc3b6bbc8f61b6798d194b0e0ebd370959df355a /.github/workflows/ci-release.yml | |
parent | 0c5834ed635833ef49fe10cc888025a5debebe21 (diff) |
chore: rewrite `scripts/` with javascript
Goals of this rewrite:
- Better portability of scripts to anywhere we can run `node` and no
reliance on `make` or other tools
- More code inside `scripts/` and less inside of CI workflows to allow
for easier local testing
- Reuse the same scripts for similar workflows (eg `publish` and
`smoke-publish`)
Future goals:
- Allow testing of `scripts`
Some highlights of the new scripts:
`scripts/create-node-pr.js`
- This now operates on cloned copy of the base repo that is pushed to
our fork, so we no longer need to manually sync our fork.
- Uses the published registry tarball for as much of the PR as possible,
falling back to including local files from source. This will enable
for easier migration to eventually only using the tarball contents.
`scripts/publish.js`
- Replaces `make publish`
- Will publish all workspaces that need to be published, before
publishing the CLI.
- Makes running tests an optional part of the script, since CI now runs
the tests.
- Can optionally only pack the tarball, for use in CI to test installing
the tarball.
`scripts/util.js`
- Shared utilities for spawning commands including helpers for `npm` and
`gh`.
- Common interface for running, parsing args, logging, and debugging
of scripts.
Diffstat (limited to '.github/workflows/ci-release.yml')
-rw-r--r-- | .github/workflows/ci-release.yml | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index 0958704ce..aaeba4b10 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -177,11 +177,6 @@ jobs: cache: npm - name: Reset Deps run: node . run resetdeps - - name: Link - if: matrix - run: node . link -f --ignore-scripts - - name: Rebuild cmark-gfm - run: node . rebuild cmark-gfm - name: Add Problem Matcher run: echo "::add-matcher::.github/matchers/tap.json" - name: Test @@ -284,18 +279,12 @@ jobs: run: | NPM_VERSION="$(node . --version)-$GITHUB_SHA.0" node . version $NPM_VERSION --ignore-scripts - node . run resetdeps - git clean -fd - node . ls --omit=dev >/dev/null - node . prune --omit=dev --no-save --no-audit --no-fund - node scripts/git-dirty.js - node . pack --pack-destination=$RUNNER_TEMP - node . install -g $RUNNER_TEMP/npm-$NPM_VERSION.tgz + node scripts/publish.js --pack-destination=$RUNNER_TEMP + node . install --global $RUNNER_TEMP/npm-$NPM_VERSION.tgz node . install -w smoke-tests --ignore-scripts --no-audit --no-fund - rm -rf {lib,bin,index.js} - # this one should be npm since we explicitly installed our packed - # tarball globally and the next test will make sure our the new - # globally installed version contains the git sha + node scripts/remove-files.js + # call installed npm instead of local source since we are testing + # the packed tarball that we just installed globally SMOKE_PUBLISH_NPM=1 npm test -w smoke-tests --ignore-scripts - name: Conclude Check uses: LouisBrunner/checks-action@v1.3.1 |