|
8 | 8 | permissions: |
9 | 9 | contents: write |
10 | 10 |
|
| 11 | +env: |
| 12 | + BINARIES: fintool hyperliquid binance coinbase polymarket |
| 13 | + |
11 | 14 | jobs: |
12 | 15 | build: |
13 | 16 | strategy: |
|
24 | 27 | artifact: fintool-macos-aarch64 |
25 | 28 | - target: x86_64-pc-windows-gnu |
26 | 29 | os: ubuntu-latest |
27 | | - artifact: fintool-windows-x86_64.exe |
| 30 | + artifact: fintool-windows-x86_64 |
28 | 31 |
|
29 | 32 | runs-on: ${{ matrix.os }} |
30 | 33 |
|
@@ -75,41 +78,45 @@ jobs: |
75 | 78 |
|
76 | 79 | - name: Verify static linking |
77 | 80 | run: | |
78 | | - bin="target/${{ matrix.target }}/release/fintool" |
79 | | - if [[ "${{ matrix.target }}" == *"windows"* ]]; then |
80 | | - bin="${bin}.exe" |
81 | | - fi |
82 | | - echo "=== Binary info ===" |
83 | | - file "$bin" |
84 | | - if [[ "${{ matrix.target }}" == *"linux-musl"* ]]; then |
85 | | - # musl binaries should be statically linked |
86 | | - if ldd "$bin" 2>&1 | grep -q "not a dynamic executable\|statically linked"; then |
87 | | - echo "✅ Static binary confirmed" |
88 | | - else |
89 | | - echo "❌ Binary is dynamically linked!" |
90 | | - ldd "$bin" |
91 | | - exit 1 |
| 81 | + for name in $BINARIES; do |
| 82 | + bin="target/${{ matrix.target }}/release/${name}" |
| 83 | + if [[ "${{ matrix.target }}" == *"windows"* ]]; then |
| 84 | + bin="${bin}.exe" |
92 | 85 | fi |
93 | | - elif [[ "${{ matrix.target }}" == *"apple-darwin"* ]]; then |
94 | | - # macOS: check no non-system dylibs |
95 | | - echo "Dynamic libraries:" |
96 | | - otool -L "$bin" || true |
97 | | - elif [[ "${{ matrix.target }}" == *"windows"* ]]; then |
98 | | - echo "Windows binary — static check via file output above" |
99 | | - fi |
| 86 | + echo "=== ${name} ===" |
| 87 | + file "$bin" |
| 88 | + if [[ "${{ matrix.target }}" == *"linux-musl"* ]]; then |
| 89 | + # musl binaries should be statically linked |
| 90 | + if ldd "$bin" 2>&1 | grep -q "not a dynamic executable\|statically linked"; then |
| 91 | + echo "✅ Static binary confirmed" |
| 92 | + else |
| 93 | + echo "❌ Binary is dynamically linked!" |
| 94 | + ldd "$bin" |
| 95 | + exit 1 |
| 96 | + fi |
| 97 | + elif [[ "${{ matrix.target }}" == *"apple-darwin"* ]]; then |
| 98 | + # macOS: check no non-system dylibs |
| 99 | + echo "Dynamic libraries:" |
| 100 | + otool -L "$bin" || true |
| 101 | + elif [[ "${{ matrix.target }}" == *"windows"* ]]; then |
| 102 | + echo "Windows binary — static check via file output above" |
| 103 | + fi |
| 104 | + done |
100 | 105 |
|
101 | 106 | - name: Package zip |
102 | 107 | run: | |
103 | 108 | dir="${{ matrix.artifact }}" |
104 | 109 | mkdir -p "$dir" |
105 | | - src="target/${{ matrix.target }}/release/fintool" |
106 | | - if [[ "${{ matrix.target }}" == *"windows"* ]]; then |
107 | | - cp "${src}.exe" "$dir/fintool.exe" |
108 | | - else |
109 | | - cp "$src" "$dir/fintool" |
110 | | - chmod +x "$dir/fintool" |
111 | | - fi |
112 | | - cp config.toml.default "$dir/" |
| 110 | + for name in $BINARIES; do |
| 111 | + src="target/${{ matrix.target }}/release/${name}" |
| 112 | + if [[ "${{ matrix.target }}" == *"windows"* ]]; then |
| 113 | + cp "${src}.exe" "$dir/${name}.exe" |
| 114 | + else |
| 115 | + cp "$src" "$dir/${name}" |
| 116 | + chmod +x "$dir/${name}" |
| 117 | + fi |
| 118 | + done |
| 119 | + cp config.toml.default "$dir/" 2>/dev/null || true |
113 | 120 | zip -r "${{ matrix.artifact }}.zip" "$dir" |
114 | 121 |
|
115 | 122 | - name: Upload artifact |
@@ -147,5 +154,5 @@ jobs: |
147 | 154 | artifacts/fintool-linux-x86_64/fintool-linux-x86_64.zip |
148 | 155 | artifacts/fintool-linux-aarch64/fintool-linux-aarch64.zip |
149 | 156 | artifacts/fintool-macos-aarch64/fintool-macos-aarch64.zip |
150 | | - artifacts/fintool-windows-x86_64.exe/fintool-windows-x86_64.exe.zip |
| 157 | + artifacts/fintool-windows-x86_64/fintool-windows-x86_64.zip |
151 | 158 | checksums.txt |
0 commit comments