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 10, 2024
1 parent 5354eaf commit 0c5a285
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 14 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) |
|----------------------------------------------------------------------------------------------------------|--------------------------------------------------|---------------------------------------------------|----------------------------------------------------|-------------------------------------------------|-------------------------------------------|
19 changes: 19 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,29 @@ 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 development_version_template.md"); next}1' CHANGES.md > temp && mv temp CHANGES.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: ""
base: master
add-paths: index.html,CHANGES.md
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
Expand Down
1 change: 0 additions & 1 deletion 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 Down
14 changes: 1 addition & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,4 @@ redocly lint beacon-node-oapi.yaml

## Releasing

1. Create and push tag

- 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

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

- 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. CD will create github release, upload bundled spec file and update other files like `index.html` and `CHANGES.md`.

0 comments on commit 0c5a285

Please sign in to comment.