Merge pull request #336 from alexsasharegan/master #690
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: | |
push: | |
branches: | |
- '**' | |
tags-ignore: | |
- '**' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Install Pre-requisites | |
run: .github/scripts/ubuntu-init.sh | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
- name: install | |
run: npm install | |
- name: lint | |
run: npm run lint | |
- name: test | |
run: npm run test | |
- name: coverage | |
run: npm run coverage:report | |
- name: Release | |
if: github.ref == 'refs/heads/master' | |
id: semantic | |
uses: cycjimmy/semantic-release-action@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Update major version tag (e.g., v1) | |
if: github.ref == 'refs/heads/master' | |
run: git tag -f v${MAJOR_VERSION} && git push --force origin refs/tags/v${MAJOR_VERSION}:refs/tags/v${MAJOR_VERSION} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
MAJOR_VERSION: ${{ steps.semantic.outputs.new_release_major_version }} |