Skip to content

Update dependency @types/node to v20.9.5 #608

Update dependency @types/node to v20.9.5

Update dependency @types/node to v20.9.5 #608

Workflow file for this run

name: Build and test
on:
pull_request:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
name: Build and test
permissions:
contents: read
actions: write
checks: write
statuses: write
steps:
- uses: actions/checkout@v3
- name: Set Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Lint
run: npm run lint
- name: Test
run: npm run ci:test
- name: Create test report
uses: phoenix-actions/test-reporting@v12
if: success() || failure() # run this step even if previous step failed
with:
name: Tests # Name of the check run which will be created
path: test-results/jest-*.xml # Path to test results
reporter: jest-junit # Format of test results
output-to: step-summary
- 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
- name: Upload dist as artifact if differences detected
uses: actions/upload-artifact@v3
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: dist/
publish:
runs-on: ubuntu-latest
name: Publish
needs: build
permissions:
contents: write # Needed to tag repo and create releases
if: ${{ github.ref == 'refs/heads/main' && startsWith(github.event.commits[0].message, 'Version Packages') }}
steps:
- uses: actions/checkout@v3
- name: Set Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Install dependencies
run: npm ci
- name: Tag repo & create releases
id: changesets_publish
uses: changesets/[email protected]
with:
publish: npm run ci:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Parse published version
id: parse_version
uses: madhead/[email protected]
with:
version: ${{ fromJSON(steps.changesets_publish.outputs.publishedPackages)[0].version }}
if: ${{ steps.changesets_publish.outputs.published }}
- name: Tag minor version
uses: richardsimko/update-tag@v1
with:
tag_name: v${{ steps.parse_version.outputs.major }}.${{ steps.parse_version.outputs.minor }}
if: ${{ steps.changesets_publish.outputs.published }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Tag major version
uses: richardsimko/update-tag@v1
with:
tag_name: v${{ steps.parse_version.outputs.major }}
if: ${{ steps.changesets_publish.outputs.published }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}