Skip to content

Commit

Permalink
msys2: move CI build to ucrt64 subsystem
Browse files Browse the repository at this point in the history
Also drop to old external NSIS binary installer, as native support
is now fully provided by MSYS2

Ref dciabrin/ngdevkit#92
  • Loading branch information
dciabrin committed May 15, 2023
1 parent c8c5955 commit f82cfb9
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 161 deletions.
18 changes: 0 additions & 18 deletions .github/scripts/build-mingw.sh

This file was deleted.

15 changes: 8 additions & 7 deletions .github/scripts/build-msys2.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/bin/bash
set -eu

autoreconf -iv
./configure \
--prefix=/mingw64 \
--build=x86_64-w64-mingw32 \
--host=x86_64-w64-mingw32 \
--target=x86_64-w64-mingw32 \
--prefix=${MSYSTEM_PREFIX} \
--build=${MSYSTEM_CHOST} \
--host=${MSYSTEM_CHOST} \
--target=${MSYSTEM_CHOST} \
--program-prefix=ngdevkit- \
--enable-msys2 \
--with-glew \
CFLAGS="-Wno-implicit-function-declaration -DGNGEORC=\\\"ngdevkit-gngeorc\\\"" \
GL_LIBS="-L/mingw64/bin -lglew32 -lopengl32"
make -j1 pkgdatadir=/mingw64/share/ngdevkit-gngeo
make install pkgdatadir=/mingw64/share/ngdevkit-gngeo
GL_LIBS="-L${MSYSTEM_PREFIX}/bin -lglew32 -lopengl32"
MSYS2_ARG_CONV_EXCL="-DDATA_DIRECTORY=" make pkgdatadir=${MSYSTEM_PREFIX}/share/ngdevkit-gngeo
make install pkgdatadir=${MSYSTEM_PREFIX}/share/ngdevkit-gngeo
110 changes: 11 additions & 99 deletions .github/workflows/build-and-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,42 +23,6 @@ jobs:
- name: Build
run: ./.github/scripts/build.sh

wincross:
name: "Windows cross-compiled Linux/MinGW"
runs-on: ubuntu-latest
env:
BUILD_PARAMS: "--host=x86_64-w64-mingw32 --enable-mingw"
PREFIX: "/tmp/build/mingw"
PKGDATADIR: "$PREFIX/share"
WINDEPS: "/tmp/deps"
SDL: "https://www.libsdl.org/release/SDL2-devel-2.0.8-mingw.tar.gz"
GLEW: "https://downloads.sourceforge.net/project/glew/glew/2.1.0/glew-2.1.0-win32.zip"
NSIS_SDL2: "http://libsdl.org/release/SDL2-2.0.10-win32-x64.zip"
NSIS_GLEW: "http://downloads.sourceforge.net/project/glew/glew/2.1.0/glew-2.1.0-win32.zip"
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Dependencies
run: |
sudo add-apt-repository -y ppa:dciabrin/ngdevkit
sudo apt-get update -y
sudo apt-get install -y emudbg-dev autoconf-archive libsdl2-dev libglew-dev
sudo apt-get install mingw-w64 libz-mingw-w64-dev emudbg-mingw-w64-dev nsis
- name: Build
run: |
./.github/scripts/build-mingw.sh
cp /tmp/build/mingw/setup-ngdevkit-gngeo-nightly.exe* .
- name: Upload NSIS installer
uses: actions/upload-artifact@v2
with:
name: nsis-artifact
path: |
setup-ngdevkit-gngeo-nightly.exe
setup-ngdevkit-gngeo-nightly.exe.sha256
win:
name: "Windows native MSYS2 build"
runs-on: windows-latest
Expand All @@ -74,19 +38,19 @@ jobs:
- name: Install MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
msystem: UCRT64
update: true
install:
git autoconf autoconf-archive automake make
mingw-w64-x86_64-gcc mingw-w64-x86_64-libtool
mingw-w64-x86_64-pkg-config mingw-w64-x86_64-SDL2
mingw-w64-x86_64-glew
mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-libtool
mingw-w64-ucrt-x86_64-pkg-config mingw-w64-ucrt-x86_64-SDL2
mingw-w64-ucrt-x86_64-glew

- name: Install ngdevkit dependencies
run: |
echo -e "[ngdevkit]\nSigLevel = Optional TrustAll\nServer = https://dciabrin.net/msys2-ngdevkit/\$arch" >> /etc/pacman.conf
pacman -Sy
pacman -S --noconfirm mingw-w64-x86_64-emudbg
pacman -S --noconfirm mingw-w64-ucrt-x86_64-emudbg
- name: Build
run: ./.github/scripts/build-msys2.sh
Expand Down Expand Up @@ -114,7 +78,7 @@ jobs:
deploy_deb:
name: "deb: trigger Launchpad rebuild"
runs-on: ubuntu-latest
needs: [linux, wincross, win, macos]
needs: [linux, win, macos]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -127,7 +91,7 @@ jobs:

deploy_rpm:
name: "rpm: trigger COPR rebuild"
needs: [linux, wincross, win, macos]
needs: [linux, win, macos]
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -152,7 +116,7 @@ jobs:
deploy_brew:
name: "brew: trigger bottle rebuild"
runs-on: ubuntu-latest
needs: [linux, wincross, win, macos]
needs: [linux, win, macos]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -169,61 +133,9 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}

deploy_nsis:
name: "win: publish NSIS installer"
runs-on: ubuntu-latest
needs: [linux, wincross, win, macos]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Download a single artifact
uses: actions/download-artifact@v2
with:
name: nsis-artifact

- name: Retrieve information from current commit
id: nsis_data
run: |
echo "::set-output name=tag::$(TZ=UTC git show --quiet --date='format-local:%Y%m%d%H%M' --format='nightly-%ad')"
echo "::set-output name=date::$(TZ=UTC git show --quiet --date='format-local:%Y-%m-%d %H:%M' --format='%ad')"
echo "::set-output name=body::$(git show --quiet --format='%s')"
- name: Create nightly NSIS installer release
id: nsis_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.nsis_data.outputs.tag }}
release_name: Nightly build - ${{ steps.nsis_data.outputs.date }}
body: Nightly build ${{ steps.nsis_data.outputs.body }}
draft: false
prerelease: true

- name: Upload nightly NSIS installer
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.nsis_release.outputs.upload_url }}
asset_path: setup-ngdevkit-gngeo-nightly.exe
asset_name: setup-ngdevkit-gngeo-nightly.exe
asset_content_type: application/vnd.microsoft.portable-executable

- name: Upload nightly NSIS installer SHA256
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.nsis_release.outputs.upload_url }}
asset_path: setup-ngdevkit-gngeo-nightly.exe.sha256
asset_name: setup-ngdevkit-gngeo-nightly.exe.sha256
asset_content_type: text/plain

deploy_msys2:
name: "msys2: trigger package rebuild"
needs: [linux, wincross, win, macos]
needs: [linux, win, macos]
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -237,14 +149,14 @@ jobs:
git config --global user.email '<>'
git config --global url."https://api@github.com/".insteadOf "https://github.com/"
git clone https://github.com/dciabrin/msys2-ngdevkit .ci/msys2-ngdevkit
.ci/msys2-ngdevkit/.ci/bump-project-nightly-build.sh ngdevkit-gngeo ngdevkit
.ci/msys2-ngdevkit/.ci/bump-project-nightly-build.sh --package ngdevkit-gngeo --branch ngdevkit --batch
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}

cleanup_tags:
name: "Cleanup tags and artefacts"
runs-on: ubuntu-latest
needs: [deploy_deb, deploy_rpm, deploy_brew, deploy_nsis, deploy_msys2]
needs: [deploy_deb, deploy_rpm, deploy_brew, deploy_msys2]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
37 changes: 5 additions & 32 deletions .github/workflows/build-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,6 @@ jobs:
- name: Build
run: ./.github/scripts/build.sh

wincross:
name: "Windows cross-compiled Linux/MinGW"
runs-on: ubuntu-latest
env:
BUILD_PARAMS: "--host=x86_64-w64-mingw32 --enable-mingw"
PREFIX: "/tmp/build/mingw"
PKGDATADIR: "$PREFIX/share"
WINDEPS: "/tmp/deps"
SDL: "https://www.libsdl.org/release/SDL2-devel-2.0.8-mingw.tar.gz"
GLEW: "https://downloads.sourceforge.net/project/glew/glew/2.1.0/glew-2.1.0-win32.zip"
NSIS_SDL2: "http://libsdl.org/release/SDL2-2.0.10-win32-x64.zip"
NSIS_GLEW: "http://downloads.sourceforge.net/project/glew/glew/2.1.0/glew-2.1.0-win32.zip"
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Dependencies
run: |
sudo add-apt-repository -y ppa:dciabrin/ngdevkit
sudo apt-get update -y
sudo apt-get install -y emudbg-dev autoconf-archive libsdl2-dev libglew-dev
sudo apt-get install mingw-w64 libz-mingw-w64-dev emudbg-mingw-w64-dev nsis
- name: Build
run: |
./.github/scripts/build-mingw.sh
win:
name: "Windows native MSYS2 build"
runs-on: windows-latest
Expand All @@ -65,19 +38,19 @@ jobs:
- name: Install MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
msystem: UCRT64
update: true
install:
git autoconf autoconf-archive automake make
mingw-w64-x86_64-gcc mingw-w64-x86_64-libtool
mingw-w64-x86_64-pkgconf mingw-w64-x86_64-SDL2
mingw-w64-x86_64-glew
mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-libtool
mingw-w64-ucrt-x86_64-pkgconf mingw-w64-ucrt-x86_64-SDL2
mingw-w64-ucrt-x86_64-glew

- name: Install ngdevkit dependencies
run: |
echo -e "[ngdevkit]\nSigLevel = Optional TrustAll\nServer = https://dciabrin.net/msys2-ngdevkit/\$arch" >> /etc/pacman.conf
pacman -Sy
pacman -S --noconfirm mingw-w64-x86_64-emudbg
pacman -S --noconfirm mingw-w64-ucrt-x86_64-emudbg
- name: Build
run: ./.github/scripts/build-msys2.sh
Expand Down
7 changes: 2 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ AC_SUBST(CC_FOR_BUILD)
# MSYS2: set a default mingw-compatible compiler
if test "x$enable_msys2" = xtrue ; then
if test "x$CC" = x ; then
CC=/mingw64/bin/x86_64-w64-mingw32-gcc.exe
CC=${MINGW_PREFIX}/bin/x86_64-w64-mingw32-gcc.exe
fi
fi

Expand Down Expand Up @@ -120,10 +120,7 @@ if test "x$enable_msys2" = xtrue || test "x$enable_mingw" = xtrue ; then
AC_SUBST(MINGW_STDIO_REALPATH)
fi
if test "x$enable_msys2" = xtrue ; then
case $target_cpu in
x86_64) PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/mingw64/lib/pkgconfig" ;;
*) PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/mingw32/lib/pkgconfig" ;;
esac
PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$MINGW_PREFIX/lib/pkgconfig
export PKG_CONFIG_PATH
if test "x$with_glew" != "xno" ; then
if test -d "$with_glew"; then
Expand Down

0 comments on commit f82cfb9

Please sign in to comment.