Update actions/setup-node action to v4 #4285
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: Deployment | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
# Cancel in-progress builds on PRs, but not on staging deploys. | |
cancel-in-progress: ${{ github.ref != 'main' }} | |
jobs: | |
deployment: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set Environment | |
run: .github/scripts/set-environment.sh | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install Dependencies | |
run: | | |
yarn install --network-timeout 100000 | |
git checkout -- package.json | |
- name: linter | |
run: yarn lint | |
- name: unit tests | |
run: yarn test | |
- name: build | |
run: yarn build-dist | |
- name: license report | |
run: yarn license-report-dist | |
- name: Prune package.json | |
run: | | |
cd dist | |
npm pkg delete scripts | |
npm pkg delete devDependencies | |
npm pkg delete eslintConfig | |
npm pkg delete resolutions | |
npm pkg delete browserslist | |
pwd | |
cat `pwd`/package.json | |
- name: compare artifact package version | |
run: .github/scripts/compare-artifact-package-versions.sh | |
- name: publish npm package | |
if: env.UPDATE_NPM_PACKAGE == 'true' | |
run: cd dist && npm publish --scope @terraware | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_AUTH_TOKEN }} |