update docs and bump @actions/artifact

This commit is contained in:
Rob Herley
2023-12-12 23:19:52 -05:00
parent 2a6c27a029
commit 6a5077f99b
6 changed files with 2665 additions and 366 deletions

View File

@ -10,9 +10,11 @@ on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
branches:
- main
paths-ignore:
- '**.md'
workflow_dispatch:
jobs:
@ -20,33 +22,32 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node 16
uses: actions/setup-node@v3
- name: Setup Node 20
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 20.x
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Move the committed index.js file
run: mv dist/index.js /tmp
- name: Rebuild with tsc
- name: Rebuild the dist/ directory
run: npm run build
- name: Rebuild the index.js file
run: npm run release
- name: Compare the expected and actual index.js files
run: git diff --ignore-all-space dist/index.js /tmp/index.js
- name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
id: diff
# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4-beta
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: index.js
path: dist/index.js
name: dist
path: dist/