-
Notifications
You must be signed in to change notification settings - Fork 2
120 lines (105 loc) · 4.56 KB
/
release-dispatch.yml
File metadata and controls
120 lines (105 loc) · 4.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
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