Skip to content

Commit

Permalink
Fully automate release process
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Aug 15, 2024
1 parent 121dcf8 commit f397698
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 18 deletions.
13 changes: 13 additions & 0 deletions .github/changes-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Development Version

These endpoints have been added or updated since the last release.

There are likely to be descriptions etc outside of the list below, but new query parameters, changes to headers, new endpoints should be listed.

| Endpoint | [Lighthouse](https://github.com/sigp/lighthouse) | [Lodestar](https://github.com/ChainSafe/lodestar) | [Nimbus](https://github.com/status-im/nimbus-eth2) | [Prysm](https://github.com/prysmaticlabs/prysm) | [Teku](https://github.com/ConsenSys/teku) |
|---------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|---------------------------------------------------|----------------------------------------------------|-------------------------------------------------|-------------------------------------------|

The Following are no longer in the Standard API, removed since the latest version.

| Endpoint | [Lighthouse](https://github.com/sigp/lighthouse) | [Lodestar](https://github.com/ChainSafe/lodestar) | [Nimbus](https://github.com/status-im/nimbus-eth2) | [Prysm](https://github.com/prysmaticlabs/prysm) | [Teku](https://github.com/ConsenSys/teku) |
|----------------------------------------------------------------------------------------------------------|--------------------------------------------------|---------------------------------------------------|----------------------------------------------------|-------------------------------------------------|-------------------------------------------|
4 changes: 3 additions & 1 deletion .github/workflows/pre-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ name: Pre-release
on:
push:
tags:
- "v*-(alpha|beta|rc).*"
- "v*-alpha.*"
- "v*-beta.*"
- "v*-rc.*"

jobs:
release:
Expand Down
29 changes: 28 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ on:
push:
tags:
- "v*"
- "!v*-(alpha|beta|rc).*"
- "!v*-alpha.*"
- "!v*-beta.*"
- "!v*-rc.*"

jobs:
release:
Expand All @@ -13,10 +15,34 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm i -g @apidevtools/swagger-cli@4
- name: Update Spec version
run: "sed -i 's/version: \"Dev/version: \"${{ github.ref_name }}/' ./beacon-node-oapi.yaml"
- name: Bundle yaml spec
run: "swagger-cli bundle ./beacon-node-oapi.yaml -r -t yaml -o ./deploy/beacon-node-oapi.yaml"
- name: Bundle json spec
run: "swagger-cli bundle ./beacon-node-oapi.yaml -r -t json -o ./deploy/beacon-node-oapi.json"
- name: Update index.html
run: |
sed -i "/urls:/a \ {url: \"./releases/${{ github.ref_name }}/beacon-node-oapi.json\", name: \"${{ github.ref_name }}\"}," ./index.html
- name: Update Changelog
run: |
sed -i "s/## Development Version/## ${{ github.ref_name }}/" ./CHANGES.md
awk '/# Recent Changes/ {print; print ""; system("cat .github/changes-template.md"); next}1' CHANGES.md > temp && mv temp CHANGES.md
- name: Create Release Notes
run: |
echo "The following changes are included in this release:" > release-notes.md
awk '/^## ${{ github.ref_name }}/ {flag=1; next} /^## / {flag=0} flag { \
if ($0 ~ /\| \[#/) {sub(/^\| /, "- "); sub(/\| .*$/, ""); sub(/[[:space:]]+$/, ""); print}}' CHANGES.md >> release-notes.md
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Release ${{ github.ref_name }}"
branch: release-${{ github.ref_name }}
title: "Release ${{ github.ref_name }}"
body-path: "release-notes.md"
base: master
add-paths: index.html,CHANGES.md
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
Expand All @@ -25,6 +51,7 @@ jobs:
with:
name: ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
body_path: "release-notes.md"
draft: false
prerelease: false
files: |
Expand Down
9 changes: 4 additions & 5 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Recent Changes


## Development Version

These endpoints have been added or updated since the last release.
Expand All @@ -24,7 +23,7 @@ The Following are no longer in the Standard API, removed since the latest versio
|----------------------------------------------------------------------------------------------------------|--------------------------------------------------|---------------------------------------------------|----------------------------------------------------|-------------------------------------------------|-------------------------------------------|


## Version 2.5.0
## v2.5.0

These endpoints have been added or updated since the last release.

Expand All @@ -41,7 +40,7 @@ There are likely to be descriptions etc outside of the list below, but new query
| [#405](https://github.com/ethereum/beacon-APIs/pull/405) `block_gossip EVENT` added | | - | | | |


## Version 2.4.2
## v2.4.2

These endpoints have been added or updated since the last release.

Expand All @@ -53,7 +52,7 @@ There are likely to be descriptions etc outside of the list below, but new query
| [#339](https://github.com/ethereum/beacon-APIs/pull/339) `POST /eth/v2/validator/*blocks` deprecated | | v1.14.0 | | | |


## Version 2.4.1
## v2.4.1

| Endpoint | [Lighthouse](https://github.com/sigp/lighthouse) | [Lodestar](https://github.com/ChainSafe/lodestar) | [Nimbus](https://github.com/status-im/nimbus-eth2) | [Prysm](https://github.com/prysmaticlabs/prysm) | [Teku](https://github.com/ConsenSys/teku) |
|---------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|---------------------------------------------------|----------------------------------------------------|-------------------------------------------------|-------------------------------------------|
Expand All @@ -70,7 +69,7 @@ There are likely to be descriptions etc outside of the list below, but new query
| [#327](https://github.com/ethereum/beacon-APIs/pull/327) Increased maximum number of blobs from 4 to 6 | | v1.9.0 | | | |


## Version 2.4.0
## v2.4.0

__Note__ Clients can add notes about level of support for specific endpoints if there are caveats or aspects not implemented.

Expand Down
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,23 @@ redocly lint beacon-node-oapi.yaml

## Releasing

1. Create and push tag
This repository supports both stable and pre-releases. The version of the next release has to be
determined based on the changes in `master` branch since the last stable release. It is recommended
to create a pre-release before releasing a new stable version.

- Make sure `info.version` in `beacon-node-oapi.yaml` file is updated before tagging. This will need to be a PR, and will get the release process started.
- CD will create github release and upload bundled spec file
### Stable releases

2. Create a second PR, containing the updated `index.html`. Also change back the `info.version` in `beacon-node-api.yaml` back to `Dev`
Steps to create a new stable release:

- The `index.html` file needs a new release entrypoint added to refer to the new release. Find the `urls` field,
and add the new release as the first entry in the list.
Entry should be in following format(replace `<tag>` with real tag name from step 1.):
```
{url: "./releases/<tag>/beacon-node-oapi.json", name: "<tag>"},
```
- Create and push a tag with the version of the release, e.g. `v3.0.0`
- CD will create the github release, upload bundled spec files, and open a release PR
- Review, approve and merge the release PR to `master` branch

### Pre-releases

To create a pre-release, simply push a new tag with the suffix `-alpha.x`. The CD will create a github release and upload the bundled spec files.
Steps to create a new pre-release:

- Create and push a tag with the version of the release, e.g. `v3.0.0-alpha.0`
- CD will create the github release and upload bundled spec files

Pre-releases will not be listed in `index.html` and are intended to allow early testing against the spec.

0 comments on commit f397698

Please sign in to comment.