File tree 2 files changed +71
-1
lines changed
2 files changed +71
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : Build binaries
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ inputs :
6
+ version :
7
+ required : true
8
+ type : string
9
+ workflow_call :
10
+ inputs :
11
+ version :
12
+ required : true
13
+ type : string
14
+
15
+ jobs :
16
+ binaries :
17
+ name : Build lodestar binaries
18
+ strategy :
19
+ matrix :
20
+ include :
21
+ - os : ubuntu-latest
22
+ build : |
23
+ npx caxa -m "Unpacking Lodestar binary, please wait..." -e "dashboards/**" -e "docs/**" -D -p "yarn install --frozen-lockfile --production" --input . --output "lodestar" -- "{{caxa}}/node_modules/.bin/node" "--max-old-space-size=8192" "{{caxa}}/node_modules/.bin/lodestar"
24
+ tar -czf "dist/lodestar-${{ inputs.version }}-linux-amd64.tar.gz" "lodestar"
25
+ runs-on : ${{matrix.os}}
26
+ steps :
27
+ - uses : actions/checkout@v4
28
+ - uses : " ./.github/actions/setup-and-build"
29
+ with :
30
+ node : 20
31
+ - run : |
32
+ mkdir -p dist
33
+ yarn global add caxa@3.0.1
34
+ ${{ matrix.build }}
35
+ - name : Upload binaries
36
+ uses : actions/upload-artifact@v4
37
+ with :
38
+ name : binaries-${{ matrix.os }}
39
+ path : dist/
40
+ if-no-files-found : error
41
+ - name : Sanity check binary
42
+ uses : actions/github-script@v7
43
+ with :
44
+ script : |
45
+ exec.exec('./lodestar dev');
46
+ await new Promise(resolve => setTimeout(resolve, 30000));
47
+ const resp = await fetch('http://127.0.0.1:9596/eth/v1/node/version').catch(err => {
48
+ core.setFailed(`Error accessing the API ${err}`);
49
+ process.exit(1);
50
+ });
51
+ if (resp.status !== 200) {
52
+ core.setFailed(`Failed to access API: ${resp.status}`);
53
+ process.exit(1);
54
+ }
55
+ process.exit(0);
Original file line number Diff line number Diff line change @@ -48,10 +48,17 @@ jobs:
48
48
tag : ${{ steps.get_tag.outputs.tag }}
49
49
prev_tag : ${{ steps.get_prev_tag.outputs.prev_tag }}
50
50
51
+ binaries :
52
+ name : Build lodestar binaries
53
+ uses : ./.github/workflows/binaries.yml
54
+ needs : tag
55
+ with :
56
+ version : ${{ needs.tag.outputs.tag }}
57
+
51
58
npm :
52
59
name : Publish to NPM & Github
53
60
runs-on : buildjet-4vcpu-ubuntu-2204
54
- needs : tag
61
+ needs : [ tag, binaries]
55
62
if : needs.tag.outputs.is_stable == 'true'
56
63
steps :
57
64
- uses : actions/checkout@v4
@@ -65,12 +72,20 @@ jobs:
65
72
- name : Generate changelog
66
73
run : node scripts/generate_changelog.mjs ${{ needs.tag.outputs.prev_tag }} ${{ needs.tag.outputs.tag }} CHANGELOG.md
67
74
75
+ - name : Get binaries
76
+ uses : actions/download-artifact@v4
77
+ with :
78
+ path : dist/
79
+ merge-multiple : true
80
+
68
81
- name : Create Release
69
82
id : create_release
70
83
uses : softprops/action-gh-release@v2
71
84
env :
72
85
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
73
86
with :
87
+ files : dist/*
88
+ fail_on_unmatched_files : true
74
89
tag_name : ${{ needs.tag.outputs.tag }}
75
90
body_path : " CHANGELOG.md"
76
91
name : Release ${{ needs.tag.outputs.tag }}
You can’t perform that action at this time.
0 commit comments