chore: opt semantic release #307
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: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- uses: pre-commit/[email protected] | |
with: | |
extra_args: --hook-stage manual --all-files | |
release: | |
name: release | |
runs-on: ubuntu-latest | |
if: github.event_name != 'pull_request' | |
permissions: | |
contents: write # write for semantic-release | |
needs: [pre-commit] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
- name: Semantic Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: > | |
npx | |
--package conventional-changelog-conventionalcommits@7 | |
--package @semantic-release/github | |
--package [email protected] | |
semantic-release@22 |