Merge pull request #171 from l2ysho/dependabot/npm_and_yarn/oxfmt-0.44.0 #238
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: Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - beta | |
| workflow_dispatch: | |
| inputs: | |
| bump: | |
| description: 'Version bump type (auto uses commit messages)' | |
| required: false | |
| default: 'auto' | |
| type: choice | |
| options: | |
| - auto | |
| - patch | |
| - minor | |
| - major | |
| permissions: | |
| contents: read | |
| jobs: | |
| test-job: | |
| name: Run tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 'lts/*' | |
| - name: Install dependencies | |
| run: npm clean-install | |
| - name: Run tests | |
| run: npm test | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| needs: [test-job] | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| id-token: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 'lts/*' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install dependencies | |
| run: npm clean-install | |
| - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies | |
| run: npm audit signatures | |
| - name: Lint | |
| run: npm run lint | |
| - name: Typecheck | |
| run: npm run typecheck | |
| - name: Build | |
| run: npm run build | |
| - name: Force version bump | |
| if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.bump != 'auto' }} | |
| run: | | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git config user.name "github-actions[bot]" | |
| BUMP="${{ github.event.inputs.bump }}" | |
| if [ "$BUMP" = "major" ]; then | |
| MSG="feat!: manual major release [skip ci]" | |
| elif [ "$BUMP" = "minor" ]; then | |
| MSG="feat: manual minor release [skip ci]" | |
| else | |
| MSG="fix: manual patch release [skip ci]" | |
| fi | |
| git commit --allow-empty -m "$MSG" | |
| - name: Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }} | |
| run: npx semantic-release |