name: Release 'on': push: branches: - main workflow_dispatch: inputs: version_type: description: Version bump type required: true default: patch type: choice options: - patch - minor - major jobs: release: runs-on: ubuntu-latest if: '!contains(github.event.head_commit.message, ''[skip ci]'')' steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '18' cache: npm - name: Install dependencies run: npm ci - name: Run tests and validation run: | npm run validate npm run format - name: Manual version bump if: github.event_name == 'workflow_dispatch' run: npm run version:${{ github.event.inputs.version_type }} - name: Semantic Release if: github.event_name == 'push' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: npm run release