@@ -11,7 +11,7 @@ permissions:
1111 packages : write
1212
1313jobs :
14- build :
14+ build-linux-windows :
1515 runs-on : ubuntu-latest
1616
1717 outputs :
3737 echo "version=${DEV_VERSION}" >> $GITHUB_OUTPUT
3838 echo "base_version=${BASE_VERSION}" >> $GITHUB_OUTPUT
3939 echo "Generated version: ${DEV_VERSION}"
40+ echo $DEV_VERSION > VERSION
4041
4142 - name : Build for Linux and Windows
4243 run : |
@@ -73,44 +74,123 @@ jobs:
7374 checksums.txt
7475 retention-days : 30
7576
77+ build-macos :
78+ runs-on : macos-latest
79+
80+ outputs :
81+ version : ${{ steps.version.outputs.version }}
82+
83+ steps :
84+ - name : Checkout code
85+ uses : actions/checkout@v4
86+ with :
87+ fetch-depth : 0
88+
89+ - name : Install dependencies
90+ run : |
91+ # Install required tools via Homebrew
92+ brew install automake autoconf libtool pandoc create-dmg
93+
94+ - name : Generate development version
95+ id : version
96+ run : |
97+ BASE_VERSION=$(cat VERSION | tr -d '\n')
98+ DATE=$(date +'%Y%m%d')
99+ SHORT_SHA=${GITHUB_SHA::7}
100+ DEV_VERSION="${BASE_VERSION}-dev.${DATE}.${SHORT_SHA}"
101+
102+ echo "version=${DEV_VERSION}" >> $GITHUB_OUTPUT
103+ echo "Generated version: ${DEV_VERSION}"
104+ echo $DEV_VERSION > VERSION
105+
106+ - name : Build libraries for macOS
107+ run : |
108+ ./macos-build-libs.sh
109+
110+ - name : Build SBaGen+ for macOS
111+ run : |
112+ ./macos-build-sbagen+.sh
113+
114+ - name : Create macOS installer
115+ run : |
116+ ./macos-create-installer.sh
117+
118+ - name : Prepare artifacts
119+ run : |
120+ mkdir -p artifacts
121+
122+ # Copy DMG installer
123+ if [ -f "dist/SBaGen+-Installer.dmg" ]; then
124+ cp dist/SBaGen+-Installer.dmg artifacts/SBaGen+-Installer.dmg
125+ fi
126+
127+ - name : Generate SHA256 checksums
128+ run : |
129+ cd artifacts
130+ find . -type f -exec shasum -a 256 {} \; | sort > ../checksums-macos.txt
131+ cat ../checksums-macos.txt
132+
133+ - name : Upload macOS artifacts
134+ uses : actions/upload-artifact@v4
135+ with :
136+ name : sbagen-plus-macos-${{ steps.version.outputs.version }}
137+ path : |
138+ artifacts/
139+ checksums-macos.txt
140+ retention-days : 30
141+
76142 create-release :
77- needs : build
143+ needs : [ build-linux-windows, build-macos]
78144 runs-on : ubuntu-latest
79145
80146 steps :
81147 - name : Checkout code
82148 uses : actions/checkout@v4
83149
84- - name : Download artifacts
150+ - name : Download Linux/Windows artifacts
85151 uses : actions/download-artifact@v4
86152 with :
87- name : sbagen-plus-${{ needs.build.outputs.version }}
153+ name : sbagen-plus-${{ needs.build-linux-windows.outputs.version }}
154+ path : linux-windows/
88155
89- - name : Generate release body with checksums
156+ - name : Download macOS artifacts
157+ uses : actions/download-artifact@v4
158+ with :
159+ name : sbagen-plus-macos-${{ needs.build-macos.outputs.version }}
160+ path : macos/
161+
162+ - name : Combine artifacts
90163 run : |
91- echo "**This is a development version and may contain bugs or unstable features.**" > release_body.md
92- echo "" >> release_body.md
93- echo "SHA256SUM:" >> release_body.md
94-
95- if [ -f checksums.txt ]; then
96- while IFS= read -r line; do
97- # Extract hash and filename
98- hash=$(echo "$line" | cut -d' ' -f1)
99- file=$(echo "$line" | cut -d' ' -f3- | sed 's|^\./||')
100- echo "$hash $file" >> release_body.md
101- done < checksums.txt
164+ mkdir -p all-artifacts
165+
166+ # Copy Linux/Windows artifacts
167+ if [ -d "linux-windows/artifacts" ]; then
168+ cp linux-windows/artifacts/* all-artifacts/ 2>/dev/null || true
102169 fi
103170
104- cat release_body.md
171+ # Copy macOS artifacts
172+ if [ -d "macos/artifacts" ]; then
173+ cp macos/artifacts/* all-artifacts/ 2>/dev/null || true
174+ fi
175+
176+ # Merge checksums
177+ if [ -f "macos/checksums-macos.txt" ]; then
178+ cat macos/checksums-macos.txt >> all-artifacts/checksums.txt
179+ rm -f macos/checksums-macos.txt
180+ fi
181+
182+ - name : Generate release body with checksums
183+ run : |
184+ echo "**This is a development version and may contain bugs or unstable features.**" > release_body.md
105185
106186 - name : Create Development Release
107187 uses : softprops/action-gh-release@v1
108188 with :
109- tag_name : v${{ needs.build.outputs.version }}
110- name : " Development Release v${{ needs.build.outputs.version }}"
189+ tag_name : v${{ needs.build-linux-windows .outputs.version }}
190+ name : " Development Release v${{ needs.build-linux-windows .outputs.version }}"
111191 body_path : release_body.md
112192 files : |
113- artifacts/*
193+ all- artifacts/*
114194 prerelease : true
115195 draft : false
116196 env :
0 commit comments