Merge pull request #2 from laurence79/dependabot/npm_and_yarn/npm_and… #26
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: | |
push: | |
branches: | |
- main | |
- alpha | |
- beta | |
- next | |
- next-major | |
- '[0-9]+.[0-9]+.x' | |
- '[0-9]+.x' | |
- 'feature/*' | |
jobs: | |
test: | |
strategy: | |
matrix: | |
version: [16, 18, 20] | |
name: Node v${{ matrix.version }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.version }} | |
cache: npm | |
- name: Dependencies | |
run: npm ci | |
- name: Test | |
run: npm run test | |
semantic_release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: [test] | |
if: success() && !startsWith(github.ref, 'refs/heads/feature') | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
cache: npm | |
- name: Dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: Semantic Release | |
uses: cycjimmy/semantic-release-action@v3.4.2 | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} |