Release Dispatch #19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Dispatch | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| binary: | |
| description: 'Binary to release' | |
| required: true | |
| type: choice | |
| options: | |
| - torii-tokens | |
| - torii-arcade | |
| - torii-server | |
| - torii-erc20 | |
| version: | |
| description: 'Release version (e.g., "1.0.0" or "v1.0.0")' | |
| required: true | |
| type: string | |
| jobs: | |
| propose-release: | |
| name: Propose Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.CREATE_PR_TOKEN }} | |
| - name: Setup Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Install cargo-release and cargo-get | |
| run: | | |
| cargo install cargo-release --version 1.1.1 | |
| cargo install cargo-get | |
| - name: Strip version prefix | |
| id: version | |
| run: | | |
| VERSION="${{ inputs.version }}" | |
| VERSION="${VERSION#v}" | |
| echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Preparing release for ${{ inputs.binary }} version: $VERSION" | |
| - name: Resolve release target | |
| id: release-target | |
| run: | | |
| RELEASE_TARGET="${{ inputs.binary }}" | |
| case "$RELEASE_TARGET" in | |
| torii-tokens) | |
| PACKAGE_NAME="torii-tokens" | |
| PACKAGE_ENTRY="bins/torii-tokens" | |
| BINARY_NAME="torii-tokens" | |
| ;; | |
| torii-arcade) | |
| PACKAGE_NAME="torii-arcade" | |
| PACKAGE_ENTRY="bins/torii-arcade" | |
| BINARY_NAME="torii-arcade" | |
| ;; | |
| torii-server) | |
| PACKAGE_NAME="torii-introspect-bin" | |
| PACKAGE_ENTRY="bins/torii-introspect-bin" | |
| BINARY_NAME="torii-server" | |
| ;; | |
| torii-erc20) | |
| PACKAGE_NAME="torii-erc20-bin" | |
| PACKAGE_ENTRY="bins/torii-erc20" | |
| BINARY_NAME="torii-erc20" | |
| ;; | |
| *) | |
| echo "Error: Unknown release target: $RELEASE_TARGET" | |
| exit 1 | |
| ;; | |
| esac | |
| echo "RELEASE_TARGET=$RELEASE_TARGET" >> $GITHUB_OUTPUT | |
| echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_OUTPUT | |
| echo "PACKAGE_ENTRY=$PACKAGE_ENTRY" >> $GITHUB_OUTPUT | |
| echo "BINARY_NAME=$BINARY_NAME" >> $GITHUB_OUTPUT | |
| - name: Bump binary version | |
| run: | | |
| cargo release version ${{ steps.version.outputs.VERSION }} --execute --no-confirm -p ${{ steps.release-target.outputs.PACKAGE_NAME }} | |
| cargo release replace --execute --no-confirm -p ${{ steps.release-target.outputs.PACKAGE_NAME }} | |
| - name: Extract new version | |
| id: release-info | |
| run: | | |
| NEW_VERSION=$(cargo get package.version --entry ${{ steps.release-target.outputs.PACKAGE_ENTRY }}) | |
| echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_OUTPUT | |
| echo "BINARY=${{ steps.release-target.outputs.BINARY_NAME }}" >> $GITHUB_OUTPUT | |
| echo "BRANCH_NAME=prepare-release-${{ steps.release-target.outputs.RELEASE_TARGET }}" >> $GITHUB_OUTPUT | |
| echo "Version bumped to: $NEW_VERSION for ${{ steps.release-target.outputs.BINARY_NAME }}" | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| token: ${{ secrets.CREATE_PR_TOKEN }} | |
| commit-message: "release(prepare): ${{ steps.release-info.outputs.BINARY }} v${{ steps.release-info.outputs.NEW_VERSION }}" | |
| title: "release(prepare): ${{ steps.release-info.outputs.BINARY }} v${{ steps.release-info.outputs.NEW_VERSION }}" | |
| body: | | |
| ## Release Preparation | |
| This PR prepares **${{ steps.release-info.outputs.BINARY }}** for version **v${{ steps.release-info.outputs.NEW_VERSION }}**. | |
| ### Changes | |
| - Updated `${{ steps.release-info.outputs.BINARY }}` binary version to `${{ steps.release-info.outputs.NEW_VERSION }}` | |
| - Updated dependencies if needed | |
| ### Next Steps | |
| Once this PR is merged, the release workflow will automatically: | |
| 1. Build `${{ steps.release-info.outputs.BINARY }}` binaries for 6 platforms (Linux, macOS, Windows on x64/ARM) | |
| 2. Create a draft GitHub release with all artifacts | |
| 3. Build and push multi-platform Docker image to GHCR: `${{ steps.release-info.outputs.BINARY }}:${{ steps.release-info.outputs.NEW_VERSION }}` | |
| **Review the changes and merge when ready to proceed with the release.** | |
| branch: ${{ steps.release-info.outputs.BRANCH_NAME }} | |
| delete-branch: true | |
| base: main |