From a9b205bd63ef8d4ea44071d03ddfd7be41751149 Mon Sep 17 00:00:00 2001 From: Cory Smith Date: Sat, 10 Sep 2022 04:29:25 -0500 Subject: [PATCH] Modified 32-bit bootstrap and release.yml. Instead of relying on "windows instance" to build 32-bit, separating so that 32-bit is specific. Also updated release.yml with, hopefully, better uploaded filenames. --- .ci/bootstrap.bat | 8 +---- .ci/bootstrap32.bat | 61 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 15 +++++---- 3 files changed, 70 insertions(+), 14 deletions(-) create mode 100644 .ci/bootstrap32.bat diff --git a/.ci/bootstrap.bat b/.ci/bootstrap.bat index 10b311939..73bbccb5b 100644 --- a/.ci/bootstrap.bat +++ b/.ci/bootstrap.bat @@ -1,11 +1,6 @@ @ECHO OFF -SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION -rem cd internal\c -rem set MINGW=mingw32 -rem IF "%PLATFORM%"=="x64" set MINGW=mingw64 -rem ren %MINGW% c_compiler -rem cd ../.. +SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION rem Check if the C++ compiler is there and skip downloading if it exists if exist internal\c\c_compiler\bin\c++.exe goto skipccompsetup @@ -71,4 +66,3 @@ cd internal\c c_compiler\bin\windres.exe -i ..\temp\icon.rc -o ..\temp\icon.o c_compiler\bin\g++ -mconsole -s -Wfatal-errors -w -Wall qbx.cpp libqb\os\win\libqb_setup.o ..\temp\icon.o -D DEPENDENCY_LOADFONT parts\video\font\ttf\os\win\src.o -D DEPENDENCY_SOCKETS -D DEPENDENCY_NO_PRINTER -D DEPENDENCY_ICON -D DEPENDENCY_NO_SCREENIMAGE parts\core\os\win\src.a -lopengl32 -lglu32 -mwindows -static-libgcc -static-libstdc++ -D GLEW_STATIC -D FREEGLUT_STATIC -lws2_32 -lwinmm -lgdi32 -o "..\..\qb64_bootstrap.exe" IF ERRORLEVEL 1 exit /b 1 - diff --git a/.ci/bootstrap32.bat b/.ci/bootstrap32.bat new file mode 100644 index 000000000..3ec70e9a2 --- /dev/null +++ b/.ci/bootstrap32.bat @@ -0,0 +1,61 @@ +@ECHO OFF + +SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION + +rem Check if the C++ compiler is there and skip downloading if it exists +if exist internal\c\c_compiler\bin\c++.exe goto skipccompsetup + +rem Create the c_compiler directory that should contain the mingw binaries +mkdir internal\c\c_compiler + +set MINGW=mingw32 +set url="https://github.com/niXman/mingw-builds-binaries/releases/download/12.2.0-rt_v10-rev0/i686-12.2.0-release-win32-sjlj-rt_v10-rev0.7z" + +echo Downloading %url%... +curl -L %url% -o temp.7z + +echo Downloading 7zr.exe... +curl -L https://www.7-zip.org/a/7zr.exe -o 7zr.exe + +echo Extracting C++ Compiler... +7zr.exe x temp.7z -y + +echo Moving C++ compiler... +for /f %%a in ('dir %MINGW% /b') do move /y "%MINGW%\%%a" internal\c\c_compiler\ + +echo Cleaning up.. +rd %MINGW% +del 7zr.exe +del temp.7z + +:skipccompsetup + +echo Building library 'LibQB' +cd internal\c\libqb\os\win +call setup_build.bat +IF ERRORLEVEL 1 exit /b 1 + +cd ..\..\..\..\.. + +echo Building library 'FreeType' +cd internal\c\parts\video\font\ttf\os\win +call setup_build.bat +IF ERRORLEVEL 1 exit /b 1 + +cd ..\..\..\..\..\..\..\.. + +echo Building library 'Core:FreeGLUT' +cd internal\c\parts\core\os\win +call setup_build.bat +IF ERRORLEVEL 1 exit /b 1 + +cd ..\..\..\..\..\.. + +echo Bootstrapping QB64 +copy internal\source\*.* internal\temp\ >nul +copy source\qb64.ico internal\temp\ >nul +copy source\icon.rc internal\temp\ >nul +cd internal\c +c_compiler\bin\windres.exe -i ..\temp\icon.rc -o ..\temp\icon.o +c_compiler\bin\g++ -mconsole -s -Wfatal-errors -w -Wall qbx.cpp libqb\os\win\libqb_setup.o ..\temp\icon.o -D DEPENDENCY_LOADFONT parts\video\font\ttf\os\win\src.o -D DEPENDENCY_SOCKETS -D DEPENDENCY_NO_PRINTER -D DEPENDENCY_ICON -D DEPENDENCY_NO_SCREENIMAGE parts\core\os\win\src.a -lopengl32 -lglu32 -mwindows -static-libgcc -static-libstdc++ -D GLEW_STATIC -D FREEGLUT_STATIC -lws2_32 -lwinmm -lgdi32 -o "..\..\qb64_bootstrap.exe" +IF ERRORLEVEL 1 exit /b 1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 680b09f61..f0573634e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: - name: Upload uses: actions/upload-artifact@v3 with: - name: upload linux ${{ github.run_number }} + name: qb64_${{ github.ref_name }}_${{ github.sha }}_lnx path: /home/runner/work/qb64/qb64_*.tar.gz macos-build: @@ -42,7 +42,7 @@ jobs: - name: Upload uses: actions/upload-artifact@v3 with: - name: upload macos ${{ github.run_number }} + name: qb64_${{ github.ref_name }}_${{ github.sha }}_osx path: /Users/runner/work/qb64/qb64_*.tar.gz windows-x86-build: @@ -53,7 +53,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Bootstrap compiler - run: .ci/bootstrap.bat + run: .ci/bootstrap32.bat - name: Compile run: .ci/compile.bat - name: Publish @@ -63,11 +63,9 @@ jobs: uses: actions/upload-artifact@v3 if: always() with: - name: upload winx86 ${{ github.run_number }} + name: qb64_${{ github.ref_name }}_${{ github.sha }}_win-x86 path: D:\a\qb64\qb64_*.7z -# path: ${{ github.workspace }}\qb64_*.7z - windows-x64-build: runs-on: windows-latest if: "!contains(github.event.head_commit.message, 'ci-skip')" @@ -85,5 +83,8 @@ jobs: - name: Upload uses: actions/upload-artifact@v3 with: - name: upload winx64 ${{ github.run_number }} + name: qb64_${{ github.ref_name }}_${{ github.sha }}_win-x64 path: D:\a\qb64\qb64_*.7z + +# ${{ github.event.repository.updated_at }} +# path: ${{ github.workspace }}\qb64_*.7z \ No newline at end of file