Skip to content

Commit ea1b812

Browse files
authored
Update release trigger (#4825)
Currently, the release action is initiated when a new tag is published. That requires cloning the ethereum/consensus-specs repo, creating a tag, and pushing the tag. This is somewhat manual and unintuitive. With this PR, the release action is triggered by running the action in the GitHub Actions page.
1 parent 69a2582 commit ea1b812

File tree

2 files changed

+26
-21
lines changed

2 files changed

+26
-21
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
name: Release
22

33
on:
4-
push:
5-
tags:
6-
- "v*"
4+
workflow_dispatch:
75

86
jobs:
97
release:
@@ -33,15 +31,18 @@ jobs:
3331
enable-cache: true
3432
version: ${{ vars.UV_VERSION }}
3533

36-
# Check the tag matches the version
37-
- name: Version check
34+
# Tag the current commit
35+
- name: Create tag
3836
run: |
39-
tag="${{ github.ref_name }}"
4037
version="v$(cat consensus-specs/tests/core/pyspec/eth2spec/VERSION.txt)"
41-
if [ "$tag" != "$version" ]; then
42-
echo "Tag ($tag) does not match version ($version)"
38+
cd consensus-specs
39+
if git rev-parse "refs/tags/$version" >/dev/null 2>&1; then
40+
echo "Error: Tag $version already exists"
4341
exit 1
4442
fi
43+
git tag "$version"
44+
git push origin "$version"
45+
echo "Created and pushed tag $version"
4546
4647
# Ensure framework tests pass
4748
- name: Run tests for framework

docs/docs/release.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
- [Introduction](#introduction)
66
- [Bump the Version](#bump-the-version)
7-
- [Tag the Release](#tag-the-release)
7+
- [Publish the Release](#publish-the-release)
88
- [Make an Announcement](#make-an-announcement)
99

1010
<!-- mdformat-toc end -->
@@ -16,7 +16,7 @@ release.
1616

1717
## Bump the Version
1818

19-
Next, update the `VERSION.txt` file which contains the eth2spec version.
19+
First, update the `VERSION.txt` file which contains the eth2spec version.
2020

2121
> [!TIP]
2222
> Click on the following link to open the GitHub editor for this file:
@@ -31,20 +31,24 @@ to 1.5.0-alpha.10").
3131

3232
Next, click the "Propose changes" button and proceed to make the PR.
3333

34-
## Tag the Release
34+
## Publish the Release
3535

36-
Next, tag the latest commit to master. This will trigger the
37-
[automated release process](../../.github/workflows/release.yml).
36+
First, go to
37+
[Actions > Release](https://github.com/ethereum/consensus-specs/actions/workflows/release.yml).
3838

39-
```bash
40-
git clone [email protected]:ethereum/consensus-specs.git
41-
cd consensus-specs
42-
git tag <version>
43-
git push origin <version>
44-
```
39+
Next, click the "Run workflow" dropdown box at the top right-hand corner.
40+
41+
Next, click the green "Run workflow" button.
4542

46-
Several hours later, the consensus-specs release will be automatically published
47-
on GitHub.
43+
> [!NOTE]
44+
> The release workflow will create a tag from `VERSION.txt` and fail if the tag
45+
> already exists. Many hours later, if successful, the consensus-specs release
46+
> will be automatically published on GitHub. The release action can take up to
47+
> 24 hours to run.
48+
49+
> [!TIP]
50+
> If the release fails, delete the tag, fix the issue, and re-run the release
51+
> workflow.
4852
4953
## Make an Announcement
5054

0 commit comments

Comments
 (0)