Skip to content

Commit cb6063c

Browse files
committed
Fix Windows build workflow and add simplified release workflow
Windows build fixes: - Add MSYS2 for autotools support (needed for atari800 autoconf/automake) - Fix Qt5 path handling for Windows path separators - Improve build tool setup New simplified release workflow: - Separates build and release concerns - Allows manual specification of build run IDs - More reliable artifact downloading - Robust file upload with existence checking - Better error handling This addresses the initial build failures by ensuring proper toolchain setup for the atari800 ExternalProject build on Windows.
1 parent 22bb1a2 commit cb6063c

File tree

2 files changed

+214
-2
lines changed

2 files changed

+214
-2
lines changed

.github/workflows/build-windows.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,28 @@ jobs:
3838
- name: Setup MSVC
3939
uses: microsoft/[email protected]
4040

41-
- name: Setup NSIS for installer creation
41+
- name: Setup build tools
4242
run: |
43+
# Install NSIS for installer creation
4344
choco install nsis -y
45+
# Install Git (should be available, but ensure it's in PATH)
46+
# Install MSYS2 for autotools (needed for atari800 build)
47+
choco install msys2 -y
48+
# Add tools to PATH
4449
echo "C:\Program Files (x86)\NSIS" >> $GITHUB_PATH
50+
echo "C:\tools\msys64\usr\bin" >> $GITHUB_PATH
4551
4652
- name: Create build directory
4753
run: mkdir build-release
4854

4955
- name: Configure CMake
5056
run: |
5157
cd build-release
58+
# Use proper path format for Windows
59+
$QtPath = "${{ env.Qt5_Dir }}".Replace('\', '/')
5260
cmake -G "Visual Studio 17 2022" -A x64 `
5361
-DCMAKE_BUILD_TYPE=Release `
54-
-DCMAKE_PREFIX_PATH="${{ env.Qt5_Dir }}" `
62+
-DCMAKE_PREFIX_PATH="$QtPath" `
5563
-DFUJISAN_VERSION="${{ github.event.inputs.version || 'dev' }}" `
5664
..
5765
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
name: Create Release (Simple)
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Release version (e.g., v1.0.0)'
8+
required: true
9+
type: string
10+
windows_run_id:
11+
description: 'Windows build run ID (get from Actions page)'
12+
required: true
13+
type: string
14+
linux_run_id:
15+
description: 'Linux build run ID (get from Actions page)'
16+
required: true
17+
type: string
18+
release_notes:
19+
description: 'Release notes (optional)'
20+
required: false
21+
default: ''
22+
type: string
23+
prerelease:
24+
description: 'Mark as pre-release'
25+
required: false
26+
default: false
27+
type: boolean
28+
29+
jobs:
30+
build-macos:
31+
runs-on: macos-latest
32+
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v4
36+
with:
37+
submodules: recursive
38+
39+
- name: Install dependencies
40+
run: |
41+
brew install cmake qt@5
42+
43+
- name: Build macOS app bundle
44+
run: |
45+
export CMAKE_PREFIX_PATH="/opt/homebrew/opt/qt@5"
46+
export FUJISAN_VERSION="${{ github.event.inputs.version }}"
47+
./scripts/build-macos-release.sh --skip-sign --skip-notarize
48+
49+
- name: Upload macOS artifacts
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: fujisan-macos-x64
53+
path: |
54+
dist/Fujisan-*.dmg
55+
dist/Fujisan-*.dmg.sha256
56+
retention-days: 30
57+
58+
create-draft-release:
59+
needs: [build-macos]
60+
runs-on: ubuntu-latest
61+
62+
steps:
63+
- name: Checkout code
64+
uses: actions/checkout@v4
65+
66+
- name: Download macOS artifacts
67+
uses: actions/download-artifact@v4
68+
with:
69+
name: fujisan-macos-x64
70+
path: artifacts/macos
71+
72+
- name: Download Windows artifacts
73+
uses: actions/download-artifact@v4
74+
with:
75+
name: fujisan-windows-x64
76+
run-id: ${{ github.event.inputs.windows_run_id }}
77+
path: artifacts/windows
78+
github-token: ${{ secrets.GITHUB_TOKEN }}
79+
80+
- name: Download Linux artifacts
81+
uses: actions/download-artifact@v4
82+
with:
83+
name: fujisan-linux-x64
84+
run-id: ${{ github.event.inputs.linux_run_id }}
85+
path: artifacts/linux
86+
github-token: ${{ secrets.GITHUB_TOKEN }}
87+
88+
- name: List all artifacts
89+
run: |
90+
echo "=== Downloaded Artifacts ==="
91+
find artifacts -type f -exec ls -lh {} \;
92+
93+
- name: Generate release notes
94+
id: release_notes
95+
run: |
96+
VERSION="${{ github.event.inputs.version }}"
97+
CUSTOM_NOTES="${{ github.event.inputs.release_notes }}"
98+
99+
if [ -n "$CUSTOM_NOTES" ]; then
100+
RELEASE_NOTES="$CUSTOM_NOTES"
101+
else
102+
# Auto-generate release notes
103+
COMMITS=$(git log --oneline --since="2 weeks ago" --pretty=format:"- %s" | head -10)
104+
105+
RELEASE_NOTES="## Fujisan $VERSION
106+
107+
### 🎮 Multi-Platform Atari 8-bit Emulator
108+
109+
Self-contained packages with Qt5 and libatari800 included - no external dependencies required.
110+
111+
### 📦 Downloads
112+
113+
- **Windows**: \`Fujisan-$VERSION-Windows-x64.msi\` - MSI installer for Windows 10/11
114+
- **Linux**: \`fujisan_*_amd64.deb\` (Debian/Ubuntu) + \`fujisan-*-linux-x64.tar.gz\` (Portable)
115+
- **macOS**: \`Fujisan-$VERSION-macOS.dmg\` - DMG installer for macOS 11.0+
116+
117+
### ✅ What's Included
118+
119+
- Complete Atari 8-bit emulation (400/800/XL/XE systems)
120+
- Modern Qt5 interface with disk management
121+
- Network debugging support via TCP server
122+
- All dependencies bundled (Qt5 frameworks + libatari800)
123+
124+
### 📋 Recent Changes
125+
126+
$COMMITS
127+
128+
### 🔐 Verification
129+
130+
Each download includes SHA256 checksums for integrity verification.
131+
132+
**Visit**: https://github.com/pedgarcia/fujisan"
133+
fi
134+
135+
# Save for next step
136+
echo "release_notes<<EOF" >> $GITHUB_OUTPUT
137+
echo "$RELEASE_NOTES" >> $GITHUB_OUTPUT
138+
echo "EOF" >> $GITHUB_OUTPUT
139+
140+
- name: Create GitHub Release
141+
id: create_release
142+
uses: actions/create-release@v1
143+
env:
144+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
145+
with:
146+
tag_name: ${{ github.event.inputs.version }}
147+
release_name: Fujisan ${{ github.event.inputs.version }}
148+
body: ${{ steps.release_notes.outputs.release_notes }}
149+
draft: true
150+
prerelease: ${{ github.event.inputs.prerelease }}
151+
152+
- name: Upload Release Assets
153+
run: |
154+
# Function to upload file if it exists
155+
upload_if_exists() {
156+
local file_pattern="$1"
157+
local asset_name="$2"
158+
local content_type="$3"
159+
160+
local file=$(find artifacts -name "$file_pattern" -type f | head -1)
161+
if [ -f "$file" ]; then
162+
echo "Uploading: $file as $asset_name"
163+
curl -s -X POST \
164+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
165+
-H "Content-Type: $content_type" \
166+
--data-binary @"$file" \
167+
"${{ steps.create_release.outputs.upload_url }}?name=$asset_name"
168+
else
169+
echo "Warning: File not found: $file_pattern"
170+
fi
171+
}
172+
173+
VERSION="${{ github.event.inputs.version }}"
174+
VERSION_CLEAN=$(echo $VERSION | sed 's/^v//')
175+
176+
# Upload Windows assets
177+
upload_if_exists "Fujisan-*-Windows-x64.msi" "Fujisan-$VERSION-Windows-x64.msi" "application/x-msi"
178+
upload_if_exists "Fujisan-*-Windows-x64.msi.sha256" "Fujisan-$VERSION-Windows-x64.msi.sha256" "text/plain"
179+
180+
# Upload Linux assets
181+
upload_if_exists "fujisan_*_amd64.deb" "fujisan_${VERSION_CLEAN}_amd64.deb" "application/vnd.debian.binary-package"
182+
upload_if_exists "fujisan_*_amd64.deb.sha256" "fujisan_${VERSION_CLEAN}_amd64.deb.sha256" "text/plain"
183+
upload_if_exists "fujisan-*-linux-x64.tar.gz" "fujisan-$VERSION-linux-x64.tar.gz" "application/gzip"
184+
upload_if_exists "fujisan-*-linux-x64.tar.gz.sha256" "fujisan-$VERSION-linux-x64.tar.gz.sha256" "text/plain"
185+
186+
# Upload macOS assets
187+
upload_if_exists "Fujisan-*-macOS.dmg" "Fujisan-$VERSION-macOS.dmg" "application/x-apple-diskimage"
188+
upload_if_exists "Fujisan-*-macOS.dmg.sha256" "Fujisan-$VERSION-macOS.dmg.sha256" "text/plain"
189+
190+
- name: Display release summary
191+
run: |
192+
echo "🎉 Draft Release Created Successfully!"
193+
echo ""
194+
echo "📝 Release Details:"
195+
echo " Version: ${{ github.event.inputs.version }}"
196+
echo " Draft: Yes (ready for testing)"
197+
echo " Pre-release: ${{ github.event.inputs.prerelease }}"
198+
echo ""
199+
echo "🔗 Release URL: ${{ steps.create_release.outputs.html_url }}"
200+
echo ""
201+
echo "📋 Next Steps:"
202+
echo " 1. Visit the release URL above"
203+
echo " 2. Download and test each platform's binaries"
204+
echo " 3. Publish the release when ready"

0 commit comments

Comments
 (0)