name: Prepare new release on: create: branches: env: CARGO_TERM_COLOR: always jobs: release: runs-on: ubuntu-22.04 if: "startsWith(github.ref, 'refs/heads/create_release/')" steps: - uses: actions/checkout@v3 - name: Install latest stable uses: actions-rs/toolchain@v1 with: toolchain: stable override: true profile: minimal - name: Install cargo-edit uses: baptiste0928/cargo-install@v1 with: crate: cargo-edit version: 0.9.1 - name: Determine version id: vars uses: actions/github-script@v5 with: script: | const { GITHUB_REF } = process.env const version = GITHUB_REF.replace('refs/heads/create_release/', '') console.log(`Got the following version: ${version}`) return version result-encoding: string - name: Bump version run: | cargo set-version --workspace ${{ steps.vars.outputs.result }} cargo generate-lockfile - name: Create Pull Request uses: peter-evans/create-pull-request@v4 with: # Need to use our own token in order to trigger additional workflows # after the branch is crated. token: ${{ secrets.PAT_TOKEN }} title: "Create release ${{ steps.vars.outputs.result }}" commit-message: "Create release ${{ steps.vars.outputs.result }}" body: "bors r+" base: main branch: create_release/${{ steps.vars.outputs.result }} delete-branch: true