P/date validator (#1008) #86
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: Test and release on pushed changeset to master | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- ".changeset/*.md" | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install npm 7 | |
run: npm i -g npm@7 --registry=https://registry.npmjs.org | |
- name: NPM install | |
run: npm ci | |
- name: Set Github identity | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "CI Agent" | |
- name: Set NPM identity | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: | | |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc | |
- name: Version | |
run: npm run version | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Update coverage badges and report | |
run: npm run cov:unit:json | |
- name: Commit version and changelog updates | |
run: "git add --all && git commit -m 'chore: version and changelog' --no-verify" | |
- name: Push versioning changes | |
run: git push origin master --follow-tags --no-verify | |
- name: Publish to NPM | |
run: npm run release:npm | |
- name: Update root package-lock.json | |
run: npm install --package-lock-only | |
- name: Commit package-lock update | |
run: "git add --all && git commit -m 'chore: update package-lock post-npm release' --no-verify" | |
- name: Push tags and package-lock changes | |
run: git push origin master --follow-tags --no-verify | |
- name: Github release | |
run: npm run release:github | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Remove .npmrc artifact | |
if: always() | |
run: rm .npmrc |