name: Prepare new release on: create: branches: - 'create_release/*' jobs: release: runs-on: ubuntu-22.04 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: Commit files # run: | # git config --local user.email "github-actions[bot]@users.noreply.github.com" # git config --local user.name "github-actions[bot]" # git commit -am "Create release ${{ steps.vars.outputs.result }}" # - name: Push changes # uses: ad-m/github-push-action@master # with: # github_token: ${{ secrets.GITHUB_TOKEN }} # branch: ${{ github.ref }} - name: Create Pull Request uses: peter-evans/create-pull-request@v4 with: # base: origin/create_release/${{ steps.vars.outputs.result }}" branch: main