Skip to content

release-dispatch

release-dispatch #154

# Dojo release dispatch workflow.
#
# This workflow is used to manually trigger a release.
#
# The workflow will propose a release with the same version as the one passed as input to the workflow, taking care of updating Cargo.toml versions.
#
# The workflow will create a PR, which must be manually merged to trigger the release.
# If the release triggered by the merged of this PR fails, the `release.yml` workflow can be used to be triggered again on main.
#
name: release-dispatch
on:
workflow_dispatch:
inputs:
version:
description: Version to release
required: true
type: string
jobs:
propose-release:
permissions:
pull-requests: write
contents: write
runs-on: ubuntu-latest
container:
image: ghcr.io/dojoengine/dojo-dev:v1.6.0
env:
VERSION: ""
steps:
# Workaround described here: https://github.com/actions/checkout/issues/760
- uses: actions/checkout@v3
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- run: |
VERSION=${{ inputs.version }}
VERSION=${VERSION#v}
cargo release version $VERSION --execute --no-confirm && cargo release replace --execute --no-confirm
- uses: peter-evans/create-pull-request@v5
with:
# We have to use a PAT in order to trigger ci
token: ${{ secrets.CREATE_PR_TOKEN }}
title: "release(prepare): v${{ inputs.version }}"
commit-message: "Prepare release: v${{ inputs.version }}"
branch: prepare-release
base: main
delete-branch: true