feat: fix CI error by requiring Node.js 20+ #628
This file contains hidden or 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: build | |
| on: [ push, pull_request ] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '20.x' | |
| - name: Install Dependency | |
| run: yarn install | |
| - name: Run Lint | |
| run: yarn run lint | |
| test: | |
| needs: [ lint ] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node: [ ^18, ^20 ] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| - name: Install Dependency | |
| run: yarn install | |
| - name: Run Unit test | |
| run: yarn run test | |
| semantic-release: | |
| needs: [ test ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '20.x' | |
| - name: Run semantic-release | |
| if: github.repository == 'casbin/casbin.js' && github.event_name == 'push' | |
| run: | | |
| yarn install --no-lockfile | |
| yarn run prepack | |
| yarn run release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |