Skip to content

Commit 3ae7ec3

Browse files
committed
WIP: merge workflows to get around checkout issue
1 parent 6c2ba1c commit 3ae7ec3

File tree

2 files changed

+171
-213
lines changed

2 files changed

+171
-213
lines changed

.github/workflows/cmake-test-on.yml

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
VCPKG_DISABLE_METRICS: true
2929
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
3030
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/vcpkg/.cache
31+
OUTPUT_BINARY: firestarr-${{ inputs.os }}-${{ inputs.target-cpu}}-${{ inputs.target-compiler }}-${{ matrix.variant }}
3132

3233
steps:
3334
- uses: actions/checkout@v4
@@ -70,3 +71,173 @@ jobs:
7071
os_version: ${{ inputs.os_version }}
7172
compiler: ${{ inputs.compiler }}
7273
triplet: ${{ inputs.triplet }}
74+
75+
- name: Locate binary (macos)
76+
if: ${{ matrix.variant == 'Release' && inputs.os == 'macos' }}
77+
id: locate-macos
78+
run: |
79+
# Find the built executable
80+
BINARY=$(find build -type f -name "firestarr" -perm +111 | head -1)
81+
if [ -z "$BINARY" ]; then
82+
echo "ERROR: Could not find firestarr binary"
83+
find build -type f -perm +111
84+
exit 1
85+
fi
86+
echo "binary=$BINARY" >> $GITHUB_OUTPUT
87+
echo "Found binary at: $BINARY"
88+
89+
- name: Check binary dependencies (macos)
90+
if: ${{ matrix.variant == 'Release' && inputs.os == 'macos' }}
91+
run: |
92+
echo "=== Binary info ==="
93+
file ${{ steps.locate-macos.outputs.binary }}
94+
echo ""
95+
echo "=== Dynamic dependencies ==="
96+
otool -L ${{ steps.locate-macos.outputs.binary }} || true
97+
98+
- name: Package artifact (macos)
99+
if: ${{ matrix.variant == 'Release' && inputs.os == 'macos' }}
100+
run: |
101+
mkdir -p dist
102+
cp ${{ steps.locate.outputs.binary }} dist/firestarr
103+
104+
# Bundle data files if they exist
105+
[ -f firestarr/fuel.lut ] && cp firestarr/fuel.lut dist/
106+
[ -f firestarr/settings.ini ] && cp firestarr/settings.ini dist/
107+
[ -f firestarr/data/fuel.lut ] && cp firestarr/data/fuel.lut dist/
108+
[ -f firestarr/data/settings.ini ] && cp firestarr/data/settings.ini dist/
109+
110+
# Create version info
111+
cd firestarr && git rev-parse HEAD > ../dist/VERSION && cd ..
112+
113+
# List contents
114+
echo "=== Package contents ==="
115+
ls -la dist/
116+
117+
# Create tarball
118+
tar -czvf ${{ env.OUTPUT_BINARY }}.tar.gz -C dist .
119+
120+
- name: Upload artifact (macos)
121+
if: ${{ matrix.variant == 'Release' && inputs.os == 'macos' }}
122+
uses: actions/upload-artifact@v4
123+
with:
124+
name: ${{ env.OUTPUT_BINARY }}
125+
path: ${{ env.OUTPUT_BINARY }}.tar.gz
126+
retention-days: 30
127+
128+
- name: Locate binary (linux)
129+
if: ${{ matrix.variant == 'Release' && inputs.os == 'linux' }}
130+
id: locate-linux
131+
run: |
132+
# Find the built executable
133+
BINARY=$(find build -type f -name "firestarr" -executable | head -1)
134+
if [ -z "$BINARY" ]; then
135+
echo "ERROR: Could not find firestarr binary"
136+
find build -type f -executable
137+
exit 1
138+
fi
139+
echo "binary=$BINARY" >> $GITHUB_OUTPUT
140+
echo "Found binary at: $BINARY"
141+
142+
- name: Check binary dependencies (linux)
143+
if: ${{ matrix.variant == 'Release' && inputs.os == 'linux' }}
144+
run: |
145+
echo "=== Binary info ==="
146+
file ${{ steps.locate-linux.outputs.binary }}
147+
echo ""
148+
echo "=== Dynamic dependencies ==="
149+
ldd ${{ steps.locate-linux.outputs.binary }} || true
150+
151+
- name: Package artifact (linux)
152+
if: ${{ matrix.variant == 'Release' && inputs.os == 'linux' }}
153+
run: |
154+
mkdir -p dist
155+
cp ${{ steps.locate.outputs.binary }} dist/firestarr
156+
157+
# Bundle data files if they exist
158+
[ -f firestarr/fuel.lut ] && cp firestarr/fuel.lut dist/
159+
[ -f firestarr/settings.ini ] && cp firestarr/settings.ini dist/
160+
[ -f firestarr/data/fuel.lut ] && cp firestarr/data/fuel.lut dist/
161+
[ -f firestarr/data/settings.ini ] && cp firestarr/data/settings.ini dist/
162+
163+
# Create version info
164+
cd firestarr && git rev-parse HEAD > ../dist/VERSION && cd ..
165+
166+
# List contents
167+
echo "=== Package contents ==="
168+
ls -la dist/
169+
170+
# Create tarball
171+
tar -czvf ${{ env.OUTPUT_BINARY }}.tar.gz -C dist .
172+
173+
- name: Upload artifact (linux)
174+
if: ${{ matrix.variant == 'Release' && inputs.os == 'linux' }}
175+
uses: actions/upload-artifact@v4
176+
with:
177+
name: ${{ env.OUTPUT_BINARY }}
178+
path: ${{ env.OUTPUT_BINARY }}.tar.gz
179+
retention-days: 30
180+
181+
- name: Locate binary (windows)
182+
if: ${{ matrix.variant == 'Release' && inputs.os == 'windows' }}
183+
id: locate-windows
184+
run: |
185+
$BINARY = Get-ChildItem -Path build -Recurse -Filter "firestarr.exe" | Select-Object -First 1 -ExpandProperty FullName
186+
if (-not $BINARY) {
187+
echo "ERROR: Could not find firestarr.exe"
188+
Get-ChildItem -Path build -Recurse -Filter "*.exe" | Select-Object FullName
189+
exit 1
190+
}
191+
echo "binary=$BINARY" >> $env:GITHUB_OUTPUT
192+
echo "Found binary at: $BINARY"
193+
shell: pwsh
194+
195+
- name: Check binary dependencies (windows)
196+
if: ${{ matrix.variant == 'Release' && inputs.os == 'windows' }}
197+
run: |
198+
echo "=== Binary info ==="
199+
Get-Item "${{ steps.locate-windows.outputs.binary }}" | Format-List Name, Length, LastWriteTime
200+
echo ""
201+
echo "=== Binary size ==="
202+
(Get-Item "${{ steps.locate-windows.outputs.binary }}").Length / 1MB | ForEach-Object { "{0:N2} MB" -f $_ }
203+
shell: pwsh
204+
205+
- name: Package artifact (windows)
206+
if: ${{ matrix.variant == 'Release' && inputs.os == 'windows' }}
207+
run: |
208+
New-Item -ItemType Directory -Force -Path dist
209+
210+
Copy-Item "${{ steps.locate.outputs.binary }}" dist\firestarr.exe
211+
212+
# Copy required DLLs from vcpkg
213+
$vcpkgBin = "C:\vcpkg\installed\x64-windows\bin"
214+
if (Test-Path $vcpkgBin) {
215+
Get-ChildItem "$vcpkgBin\*.dll" | Copy-Item -Destination dist\
216+
}
217+
218+
# Bundle data files if they exist
219+
if (Test-Path firestarr\fuel.lut) { Copy-Item firestarr\fuel.lut dist\ }
220+
if (Test-Path firestarr\settings.ini) { Copy-Item firestarr\settings.ini dist\ }
221+
if (Test-Path firestarr\data\fuel.lut) { Copy-Item firestarr\data\fuel.lut dist\ }
222+
if (Test-Path firestarr\data\settings.ini) { Copy-Item firestarr\data\settings.ini dist\ }
223+
224+
# Create version info
225+
cd firestarr
226+
git rev-parse HEAD | Out-File -FilePath ..\dist\VERSION -Encoding utf8
227+
cd ..
228+
229+
# List contents
230+
echo "=== Package contents ==="
231+
Get-ChildItem dist
232+
233+
# Create zip
234+
Compress-Archive -Path dist\* -DestinationPath ${{ env.OUTPUT_BINARY }}.zip
235+
shell: pwsh
236+
237+
- name: Upload artifact (windows)
238+
if: ${{ matrix.variant == 'Release' && inputs.os == 'windows' }}
239+
uses: actions/upload-artifact@v4
240+
with:
241+
name: ${{ env.OUTPUT_BINARY }}
242+
path: ${{ env.OUTPUT_BINARY }}.zip
243+
retention-days: 30

.github/workflows/package-binary.yml

Lines changed: 0 additions & 213 deletions
This file was deleted.

0 commit comments

Comments
 (0)