Add script to update class-validator #117
Workflow file for this run
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: CI | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- closed | |
branches: | |
- main | |
jobs: | |
CI: | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "${{ github.actor }}" | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
- name: Use Node.js 20.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
registry-url: "https://registry.npmjs.org" | |
- run: npm ci | |
- name: Lint | |
run: npm run lint | |
- name: Build | |
run: npm run build | |
- name: Bump version | |
if: | | |
github.base_ref == 'main' && | |
github.event.pull_request.merged == true | |
run: echo "NEW_VERSION=$(npm --no-git-tag-version version minor)" >> $GITHUB_ENV | |
- name: Commit package.json | |
if: | | |
github.base_ref == 'main' && | |
github.event.pull_request.merged == true | |
uses: EndBug/add-and-commit@v9 | |
with: | |
message: Publish ${{ env.NEW_VERSION }} | |
- name: Publish release | |
if: | | |
github.base_ref == 'main' && | |
github.event.pull_request.merged == true | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |