clean up and use node 20 (#1) #4
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: Build | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
- uses: actions/setup-node@v4.0.2 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: | | |
npm install | |
- name: Clean, build, format, lint, package, and test | |
run: | | |
npm run all | |
- name: Check if packaged properly | |
run: | | |
# If there are any unstaged or untracked files in 'dist/', then the action wasn't packaged properly | |
if git diff --name-only | grep '^dist/' || git ls-files --other --exclude-standard | grep '^dist/'; then | |
echo "You didn't package the action properly before pushing to remote." \ | |
echo "Always run 'npm ru all' before staging a commit." | |
echo "Below are the modified files in 'dist/' after running 'npm && rm -rf dist/ && npm run all':" | |
git diff --name-only | grep '^dist/' | |
git ls-files --other --exclude-standard | grep '^dist/' | |
exit 1 | |
fi |