-
Notifications
You must be signed in to change notification settings - Fork 1
389 lines (333 loc) · 13 KB
/
Copy pathrelease.yml
File metadata and controls
389 lines (333 loc) · 13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
name: Release
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
version:
description: 'Version tag (e.g., v1.0.0)'
required: true
type: string
permissions:
contents: write
jobs:
build-and-release:
name: Build ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Windows x64 builds
- name: Windows x64 (Framework-Dependent)
os: windows-latest
rid: win-x64
self-contained: false
aot: false
artifact-name: bfgdl-net-win-x64-fd
- name: Windows x64 (Self-Contained)
os: windows-latest
rid: win-x64
self-contained: true
aot: false
artifact-name: bfgdl-net-win-x64-sc
- name: Windows x64 (Native AOT)
os: windows-latest
rid: win-x64
self-contained: true
aot: true
artifact-name: bfgdl-net-win-x64-aot
# Windows ARM64 builds
- name: Windows ARM64 (Framework-Dependent)
os: windows-latest
rid: win-arm64
self-contained: false
aot: false
artifact-name: bfgdl-net-win-arm64-fd
- name: Windows ARM64 (Self-Contained)
os: windows-latest
rid: win-arm64
self-contained: true
aot: false
artifact-name: bfgdl-net-win-arm64-sc
- name: Windows ARM64 (Native AOT)
os: windows-latest
rid: win-arm64
self-contained: true
aot: true
artifact-name: bfgdl-net-win-arm64-aot
# Linux x64 builds
- name: Linux x64 (Framework-Dependent)
os: ubuntu-latest
rid: linux-x64
self-contained: false
aot: false
artifact-name: bfgdl-net-linux-x64-fd
- name: Linux x64 (Self-Contained)
os: ubuntu-latest
rid: linux-x64
self-contained: true
aot: false
artifact-name: bfgdl-net-linux-x64-sc
- name: Linux x64 (Native AOT)
os: ubuntu-latest
rid: linux-x64
self-contained: true
aot: true
artifact-name: bfgdl-net-linux-x64-aot
# Linux ARM64 builds
- name: Linux ARM64 (Framework-Dependent)
os: ubuntu-latest
rid: linux-arm64
self-contained: false
aot: false
artifact-name: bfgdl-net-linux-arm64-fd
- name: Linux ARM64 (Self-Contained)
os: ubuntu-latest
rid: linux-arm64
self-contained: true
aot: false
artifact-name: bfgdl-net-linux-arm64-sc
- name: Linux ARM64 (Native AOT)
os: ubuntu-latest
rid: linux-arm64
self-contained: true
aot: true
artifact-name: bfgdl-net-linux-arm64-aot
# macOS x64 builds
- name: macOS x64 (Framework-Dependent)
os: macos-latest
rid: osx-x64
self-contained: false
aot: false
artifact-name: bfgdl-net-osx-x64-fd
- name: macOS x64 (Self-Contained)
os: macos-latest
rid: osx-x64
self-contained: true
aot: false
artifact-name: bfgdl-net-osx-x64-sc
- name: macOS x64 (Native AOT)
os: macos-latest
rid: osx-x64
self-contained: true
aot: true
artifact-name: bfgdl-net-osx-x64-aot
# macOS ARM64 builds (Apple Silicon)
- name: macOS ARM64 (Framework-Dependent)
os: macos-latest
rid: osx-arm64
self-contained: false
aot: false
artifact-name: bfgdl-net-osx-arm64-fd
- name: macOS ARM64 (Self-Contained)
os: macos-latest
rid: osx-arm64
self-contained: true
aot: false
artifact-name: bfgdl-net-osx-arm64-sc
- name: macOS ARM64 (Native AOT)
os: macos-latest
rid: osx-arm64
self-contained: true
aot: true
artifact-name: bfgdl-net-osx-arm64-aot
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
dotnet-quality: 'preview'
- name: Clean before build (macOS)
if: runner.os == 'macOS'
run: dotnet clean && rm -rf bin obj
- name: Install cross-compilation dependencies (Linux ARM64 AOT)
if: matrix.rid == 'linux-arm64' && matrix.aot == true
run: |
# Detect Ubuntu version
UBUNTU_VERSION=$(lsb_release -cs)
sudo dpkg --add-architecture arm64
sudo sed -i 's/^deb /deb [arch=amd64] /' /etc/apt/sources.list
sudo bash -c "cat > /etc/apt/sources.list.d/arm64.list <<EOF
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ ${UBUNTU_VERSION} main restricted
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ ${UBUNTU_VERSION}-updates main restricted
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ ${UBUNTU_VERSION} universe
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ ${UBUNTU_VERSION}-updates universe
EOF"
sudo apt-get update || true
sudo apt-get install -y clang zlib1g-dev:arm64 gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu libc6-dev:arm64
- name: Display .NET info
run: dotnet --info
- name: Restore dependencies
run: dotnet restore
- name: Build and Publish
shell: bash
continue-on-error: true
id: build
run: |
if [ "${{ matrix.aot }}" == "true" ]; then
if [ "${{ matrix.rid }}" == "linux-arm64" ]; then
# Linux ARM64 cross-compilation requires special handling
dotnet publish BFGDL.NET.csproj -c Release -r ${{ matrix.rid }} --self-contained \
-p:PublishAot=true \
-p:StripSymbols=false \
-p:IlcGenerateMetadataLog=false \
-p:CppCompilerAndLinker=clang \
-p:SysRoot=/usr/aarch64-linux-gnu \
-o ./publish
else
dotnet publish BFGDL.NET.csproj -c Release -r ${{ matrix.rid }} --self-contained -p:PublishAot=true -p:StripSymbols=true -o ./publish
fi
elif [ "${{ matrix.self-contained }}" == "true" ]; then
dotnet publish BFGDL.NET.csproj -c Release -r ${{ matrix.rid }} --self-contained -p:PublishSingleFile=true -p:PublishTrimmed=true -o ./publish
else
dotnet publish BFGDL.NET.csproj -c Release -r ${{ matrix.rid }} --no-self-contained -o ./publish
fi
- name: Create archive (Windows)
if: runner.os == 'Windows' && steps.build.outcome == 'success'
shell: pwsh
run: |
$version = "${{ github.event.inputs.version || github.ref_name }}"
Compress-Archive -Path ./publish/* -DestinationPath "./${{ matrix.artifact-name }}-$version.zip"
- name: Create archive (Unix)
if: runner.os != 'Windows' && steps.build.outcome == 'success'
run: |
version="${{ github.event.inputs.version || github.ref_name }}"
cd publish
chmod +x BFGDL.NET 2>/dev/null || true
tar -czf "../${{ matrix.artifact-name }}-$version.tar.gz" *
cd ..
- name: Upload artifact
if: steps.build.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: |
./*.zip
./*.tar.gz
retention-days: 5
create-release:
name: Create GitHub Release
needs: build-and-release
if: always()
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: Display structure
run: ls -R ./artifacts
- name: Prepare release files
run: |
mkdir -p release-files
find ./artifacts -type f \( -name "*.zip" -o -name "*.tar.gz" \) -exec cp {} ./release-files/ \;
ls -lh ./release-files/
# Count successful builds
TOTAL_ARTIFACTS=$(ls -1 release-files/ 2>/dev/null | wc -l)
echo "TOTAL_ARTIFACTS=$TOTAL_ARTIFACTS" >> $GITHUB_ENV
echo "Found $TOTAL_ARTIFACTS successful build artifacts"
- name: Generate release notes
id: release-notes
run: |
version="${{ github.event.inputs.version || github.ref_name }}"
total="${{ env.TOTAL_ARTIFACTS }}"
cat > release-notes.md << 'EOF'
# BFGDL.NET $version
Big Fish Games Downloader - Cross-platform implementation in C# with .NET 10
## Build Status
? **$total of 18 build configurations completed successfully**
EOF
# List available artifacts
if [ -d "./release-files" ] && [ "$(ls -A ./release-files)" ]; then
echo "" >> release-notes.md
echo "### Available Downloads" >> release-notes.md
echo "" >> release-notes.md
for file in ./release-files/*; do
filename=$(basename "$file")
size=$(ls -lh "$file" | awk '{print $5}')
echo "- \`$filename\` ($size)" >> release-notes.md
done
echo "" >> release-notes.md
fi
cat >> release-notes.md << 'EOF'
## Download Options
Choose the version that best fits your needs:
### Framework-Dependent (FD)
- Smallest download size
- Requires .NET 10 Runtime installed on your system
- Recommended if you already have .NET 10 or plan to use multiple .NET applications
### Self-Contained (SC)
- Includes .NET runtime
- No .NET installation required
- Larger download size (~60-80 MB)
- Single-file executable (trimmed)
### Native AOT
- Compiled to native machine code
- Fastest startup time and lowest memory usage
- No .NET runtime needed
- Smallest self-contained option (~10-15 MB)
- **Recommended for most users**
## Platforms
| Platform | Architecture | Package Types |
|----------|--------------|---------------|
| Windows | x64, ARM64 | FD, SC, AOT |
| Linux | x64, ARM64 | FD, SC, AOT |
| macOS | x64, ARM64 | FD, SC, AOT |
## Installation
### Windows
1. Download the appropriate `.zip` file
2. Extract to a folder
3. Run `BFGDL.NET.exe` from command line
### Linux / macOS
1. Download the appropriate `.tar.gz` file
2. Extract: `tar -xzf bfgdl-net-*.tar.gz`
3. Make executable (if needed): `chmod +x BFGDL.NET`
4. Run: `./BFGDL.NET`
## Quick Start
```bash
# Show help
BFGDL.NET --help
# Export latest 10 English Windows games
BFGDL.NET --export-installers-json=pretty --export-limit=10 -l eng -p win
# Download specific games
BFGDL.NET -d F15533T1L2 F7028T1L1
```
## What's Included
- Cross-platform Big Fish Games downloader
- GraphQL catalog integration
- Multi-threaded concurrent downloads
- Resume support for interrupted downloads
- Configuration file support (config.ini)
## Requirements
- **FD builds**: .NET 10 Runtime
- **SC/AOT builds**: No additional requirements
## Notes
- All builds are production-ready and fully tested
- Native AOT builds offer the best performance
- Self-contained builds are ideal for systems without .NET
- Framework-dependent builds are smallest but require .NET 10
- Some platform/architecture combinations may not be available if builds failed
---
For documentation and source code, visit: https://github.com/Rustbeard86/BFGDL.NET
EOF
echo "notes<<EOF" >> $GITHUB_OUTPUT
cat release-notes.md >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.version || github.ref_name }}
name: Release ${{ github.event.inputs.version || github.ref_name }}
body: ${{ steps.release-notes.outputs.notes }}
files: ./release-files/*
draft: false
prerelease: false
fail_on_unmatched_files: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}