on: create: branches: - 'create_release/*' jobs: release: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - name: Install latest stable uses: actions-rs/toolchain@v1 with: toolchain: stable override: true - name: Install cargo-edit uses: baptiste0928/cargo-install@v1 with: crate: cargo-edit - 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 }}