mirror of
https://github.com/actions/upload-artifact.git
synced 2025-04-08 07:19:37 +00:00
update docs and bump @actions/artifact
This commit is contained in:
39
.github/workflows/check-dist.yml
vendored
39
.github/workflows/check-dist.yml
vendored
@ -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/
|
||||
|
Reference in New Issue
Block a user