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

feat: add lodestar binaries to release #6666

Merged
merged 14 commits into from
Apr 24, 2024
55 changes: 55 additions & 0 deletions .github/workflows/binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build binaries

on:
workflow_dispatch:
inputs:
version:
required: true
type: string
workflow_call:
inputs:
version:
required: true
type: string

jobs:
binaries:
name: Build lodestar binaries
strategy:
matrix:
include:
- os: ubuntu-latest
build: |
npx caxa -m "This may take a while to run the first time, please wait..." -e "dashboards/**" -e "docs/**" -D -p "yarn install --production" --input . --output "lodestar" -- "{{caxa}}/node_modules/.bin/node" "--max-old-space-size=8192" "{{caxa}}/node_modules/.bin/lodestar"
tar -czf "dist/lodestar-${{ inputs.version }}-linux-amd64.tar.gz" "lodestar"
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- uses: "./.github/actions/setup-and-build"
with:
node: 20
- run: |
mkdir -p dist
yarn global add caxa@3.0.1
${{ matrix.build }}
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: binaries-${{ matrix.os }}
path: dist/
if-no-files-found: error
- name: Sanity check binary
uses: actions/github-script@v7
with:
script: |
exec.exec('./lodestar dev');
await new Promise(resolve => setTimeout(resolve, 30000));
const resp = await fetch('http://127.0.0.1:9596/eth/v1/node/version').catch(err => {
core.setFailed(`Error accessing the API ${err}`);
process.exit(1);
});
if (resp.status !== 200) {
core.setFailed(`Failed to access API: ${resp.status}`);
process.exit(1);
}
process.exit(0);
17 changes: 16 additions & 1 deletion .github/workflows/publish-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,17 @@ jobs:
tag: ${{ steps.get_tag.outputs.tag }}
prev_tag: ${{ steps.get_prev_tag.outputs.prev_tag }}

binaries:
name: Build lodestar binaries
uses: ./.github/workflows/binaries.yml
needs: tag
with:
version: ${{ needs.tag.outputs.tag }}

npm:
name: Publish to NPM & Github
runs-on: buildjet-4vcpu-ubuntu-2204
needs: tag
needs: [tag, binaries]
if: needs.tag.outputs.is_stable == 'true'
steps:
- uses: actions/checkout@v4
Expand All @@ -65,12 +72,20 @@ jobs:
- name: Generate changelog
run: node scripts/generate_changelog.mjs ${{ needs.tag.outputs.prev_tag }} ${{ needs.tag.outputs.tag }} CHANGELOG.md

- name: Get binaries
uses: actions/download-artifact@v4
with:
path: dist/
merge-multiple: true

- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: dist/*
fail_on_unmatched_files: true
tag_name: ${{ needs.tag.outputs.tag }}
body_path: "CHANGELOG.md"
name: Release ${{ needs.tag.outputs.tag }}
Expand Down
Loading