diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..57be589 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,41 @@ +name: release + +on: + pull_request: + types: + - closed + +jobs: + release: + if: > + github.event.pull_request.merged == true && + contains(github.event.pull_request.labels.*.name, 'bump:patch') + runs-on: ubuntu-latest + + steps: + # Repository + - name: Checkout the code + uses: actions/checkout@v4 + with: + fetch-depth: 0 # BumpVer needs tags + + # Environment + - name: Set up Pixi + uses: prefix-dev/setup-pixi@v0.8.9 + + - name: Set Git identity + run: | + git config user.name 'github-actions[bot]' + git config user.email 'github-actions[bot]@users.noreply.github.com' + + - name: Bump version + run: | + pixi run bumpver update --patch + + - name: Create Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref_name }} + release_name: "Release ${{ github.ref_name }}"