Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow to create pre-releases #463

Merged
merged 5 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/pre-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Pre-release

on:
push:
tags:
- "v*-(alpha|beta|rc).*"

jobs:
release:
runs-on: ubuntu-latest
steps:
- 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: Create Release Notes
run: |
echo "The following changes are included in this release:" > release-notes.md
awk '/^## Development Version/ {flag=1; next} /^## / {flag=0} flag { \
if ($0 ~ /\| \[#/) {sub(/^\| /, "- "); sub(/\| .*$/, ""); sub(/[[:space:]]+$/, ""); print}}' CHANGES.md >> release-notes.md
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
body_path: "release-notes.md"
draft: false
prerelease: true
files: |
./deploy/beacon-node-oapi.yaml
./deploy/beacon-node-oapi.json
fail_on_unmatched_files: true
- name: Rollback Release
if: failure()
uses: author/action-rollback@1.0.4
with:
release_id: ${{ steps.create_release.outputs.id }}
tag: ${{ github.ref }}
delete_orphan_tag: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
tags:
- "v*"
- "!v*-(alpha|beta|rc).*"

jobs:
release:
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,9 @@ redocly lint beacon-node-oapi.yaml
```
{url: "./releases/<tag>/beacon-node-oapi.json", name: "<tag>"},
```

### 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.

Pre-releases will not be listed in `index.html` and are intended to allow early testing against the spec.
1 change: 1 addition & 0 deletions wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ MEV
PayloadAttributesV
Gwei
prev
pre
ENR
enr
attnets
Expand Down