# Adapted from https://github.com/joshka/github-workflows/blob/main/.github/workflows/rust-release-plz.yml # Thanks to joshka for permission to use this template! name: Create release permissions: pull-requests: write contents: write on: workflow_dispatch: inputs: bump_type: description: "Specify the type of version bump" required: true default: "patch" type: choice options: - patch - minor - major jobs: bump: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3 with: fetch-depth: 0 - name: Configure Git user run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - name: Set up Python uses: actions/setup-python@v4 with: python-version: "3.x" # Specify your required Python version - name: Install Commitizen run: | python -m pip install --upgrade pip pip install commitizen - name: Bump version with Commitizen run: | cz bump --yes --increment ${{ github.event.inputs.bump_type }} - name: Push changes env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | git push origin main --follow-tags --force release-plz: # see https://release-plz.ieni.dev/docs/github # for more information name: Release-plz runs-on: ubuntu-latest steps: - name: Check if actor is repository owner if: ${{ github.actor != github.repository_owner }} run: | echo "You are not authorized to run this workflow." exit 1 - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install Rust stable uses: dtolnay/rust-toolchain@stable - name: Run release-plz uses: MarcoIeni/release-plz-action@v0.5 with: command: release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}