Skip to content

Commit f25eed5

Browse files
authored
Auto compilation for releases (#7)
* Add GitHub Actions workflow for Build and Release * Add debugging steps to the build process in GitHub Actions * Change 'pwd' to 'ls' in Build step for improved directory listing * Add debugging steps for workspace contents in Windows and Unix environments * Remove unnecessary directory change in Build step for MrBig release workflow * Update paths for tools in Build step and enhance MSYS2 build logging * Enhance MSYS2 build step with updated PATH and compiler checks * Refactor build workflow to streamline artifact upload process and remove commented-out code * Change shell to msys2 for Create release archive step in build workflow * Add conditional checks for uploading build artifacts and release assets
1 parent 6072273 commit f25eed5

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed

.github/workflows/main.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Build and Release MrBig
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: windows-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Cygwin
17+
uses: cygwin/cygwin-install-action@master
18+
with:
19+
packages: make zip gcc-core gcc-g++ binutils
20+
21+
- name: Setup MinGW-w64
22+
uses: msys2/setup-msys2@v2
23+
with:
24+
msystem: MINGW64
25+
update: true
26+
install: >-
27+
mingw-w64-x86_64-gcc
28+
mingw-w64-x86_64-make
29+
mingw-w64-i686-gcc
30+
mingw-w64-i686-make
31+
make
32+
33+
- name: Debug workspace contents (Windows)
34+
shell: cmd
35+
run: |
36+
echo Current working directory:
37+
cd
38+
echo Workspace directory: ${{ github.workspace }}
39+
echo Contents of workspace:
40+
dir "${{ github.workspace }}"
41+
echo Looking for Makefile:
42+
dir "${{ github.workspace }}\Makefile"
43+
44+
45+
- name: Build MrBig
46+
shell: msys2 {0}
47+
run: |
48+
export PATH="/mingw64/bin:/mingw32/bin:/usr/bin:$PATH"
49+
echo "Checking available compilers:"
50+
which gcc || echo "gcc not found"
51+
which x86_64-w64-mingw32-gcc || echo "x86_64-w64-mingw32-gcc not found"
52+
which i686-w64-mingw32-gcc || echo "i686-w64-mingw32-gcc not found"
53+
echo "Running make..."
54+
make
55+
56+
- name: Create release archive
57+
if: startsWith(github.ref, 'refs/tags/')
58+
shell: msys2 {0}
59+
run: |
60+
mkdir -p release
61+
# Copy built binaries to release directory
62+
if [ -f "mrbig.exe" ]; then
63+
cp mrbig.exe release/
64+
fi
65+
if [ -d "X64" ] && [ -f "X64/mrbig64.exe" ]; then
66+
cp X64/mrbig64.exe release/mrbig64.exe
67+
fi
68+
if [ -d "X86" ] && [ -f "X86/mrbig.exe" ]; then
69+
cp X86/mrbig.exe release/mrbig.exe
70+
fi
71+
72+
- name: Upload build artifacts
73+
if: github.event_name == 'release'
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: mrbig-binaries
77+
path: |
78+
X64/mrbig64.exe
79+
X86/mrbig.exe
80+
if-no-files-found: warn
81+
82+
- name: Upload Release Assets
83+
if: github.event_name == 'release'
84+
uses: softprops/action-gh-release@v1
85+
with:
86+
files: |
87+
X64/mrbig64.exe
88+
X86/mrbig.exe
89+
env:
90+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+

0 commit comments

Comments
 (0)