build(deps): bump follow-redirects from 1.15.3 to 1.15.4 #11
Workflow file for this run
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
name: Test and Conditionally Publish | |
on: | |
push: | |
paths-ignore: | |
- '.anylint' | |
- '.editorconfig' | |
- '.env.example' | |
- '.gitattributes' | |
- '.gitignore' | |
- 'commitlint.config.js' | |
- 'LICENSE' | |
pull_request: | |
branches: | |
- master | |
paths-ignore: | |
- '.anylint' | |
- '.editorconfig' | |
- '.env.example' | |
- '.gitattributes' | |
- '.gitignore' | |
- 'commitlint.config.js' | |
- 'LICENSE' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8.12.1 | |
run_install: false # For cache | |
- name: Read .nvmrc | |
id: nvmrc | |
run: echo "version=$(cat .nvmrc)" >> $GITHUB_OUTPUT | |
- name: Set Up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ steps.nvmrc.outputs.version }} | |
cache: pnpm | |
- name: Install Dependencies | |
run: pnpm install --silent --frozen-lockfile --ignore-scripts | |
env: | |
CI: true | |
- name: Test And Measure Coverage | |
run: pnpm test:coverage --ci | |
- name: Lint | |
run: pnpm lint . | |
- name: Lint Markdown | |
run: pnpm lint:md . | |
e2etest: | |
needs: test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
node-version: [16, 18, 20] | |
os: [ubuntu-latest, macOS-latest, windows-latest, windows-2019] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8.12.1 | |
run_install: false # For cache | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: pnpm | |
- name: Install Dependencies | |
# only installs packages needed to publish to save time | |
run: pnpm install --silent --frozen-lockfile --ignore-scripts | |
env: | |
CI: true | |
- name: Run Local Npm Registry (Verdaccio) On Linux Or macOS | |
# verdaccio is private npm registry. [link](https://github.com/verdaccio/verdaccio/) | |
if: startsWith(matrix.os, 'windows') == false # use an operrator "==" as "!startsWith(matrix.os, 'windows')" causes an error | |
run: | | |
# trailing `&` detaches process from foreground | |
pnpm verdaccio & | |
- name: Run Local Npm Registry (Verdaccio) On Windows | |
if: startsWith(matrix.os, 'windows') | |
run: | | |
pnpm add --global forever | |
forever start node_modules\verdaccio\bin\verdaccio --config ./verdaccio/conf/default.yaml | |
- name: Publish To Local NPM Registry | |
run: | | |
# From npm v7, `npm adduser` is required before `npm publish`. | |
# (adduser REF: https://docs.npmjs.com/cli/v7/commands/npm-adduser) | |
# However, `npm adduser` is interactive | |
# and can be substituted by setting `_authToken`. | |
# By local verdaccio setting(verdaccio/conf/default.yaml), | |
# the _authToken can be any random string, | |
# and anyone can publish hasura-cli. | |
npm config set //localhost:4873/:_authToken helloworld | |
npm publish --registry http://localhost:4873 | |
- name: Test Installation | |
run: | | |
npm install --global hasura-cli --registry http://localhost:4873 | |
hasura version --skip-update-check | |
- name: Test Uninstallation | |
if: startsWith(matrix.os, 'windows') == false | |
run: npm uninstall --global hasura-cli | |
publish: | |
needs: e2etest | |
if: startsWith(github.ref, 'refs/tags/v2.') && ( github.event.base_ref == 'refs/heads/master' ) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8.12.1 | |
run_install: false # For cache | |
- name: Read .nvmrc | |
id: nvmrc | |
run: echo "version=$(cat .nvmrc)" >> $GITHUB_OUTPUT | |
- name: Set Up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ steps.nvmrc.outputs.version }} | |
cache: pnpm | |
- name: Install Dependencies | |
run: pnpm install --silent --frozen-lockfile --ignore-scripts | |
env: | |
CI: true | |
- name: Build and Publish | |
# only runs if name of git tag starts with 'v1.' and on branch master | |
run: | | |
pnpm build # to prevent a mistake thougth there is already prepublishOnly lifecycle hook. | |
pnpm publish | |
env: | |
CI: true | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |