Skip to content

Merge pull request #190 from dmalec/cd_osx_x86_support #65

Merge pull request #190 from dmalec/cd_osx_x86_support

Merge pull request #190 from dmalec/cd_osx_x86_support #65

Workflow file for this run

name: CD
on:
push:
branches:
- cd_*
- master
- release*
env:
WX_WIDGETS_VERSION: 3.2.2.1
TARGET_OSX_VERSION: 10.14
jobs:
# ############################################################################
# The build_wxwidgets_<platform> jobs handle building and caching wxWidgets.
#
# This reduces total build time by a measurable amount, as wxWidgets can take
# over 30 minutes to build.
# ############################################################################
build_wxwidgets_linux:
name: Build wxWidgets for Linux
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Cache wxWidgets
uses: actions/cache@v4
id: wxwidgets-cache
with:
path: ${{ runner.temp }}/wxWidgets-${{ env.WX_WIDGETS_VERSION }}
key: ${{ runner.os }}-wxWidgets-${{ env.WX_WIDGETS_VERSION }}
- name: Update Package Info
if: steps.wxwidgets-cache.outputs.cache-hit != 'true'
run: |
sudo apt-get update
- name: Install Dependencies
if: steps.wxwidgets-cache.outputs.cache-hit != 'true'
run: >
sudo apt-get install libgtk-3-dev
- name: Download wxWidgets
if: steps.wxwidgets-cache.outputs.cache-hit != 'true'
working-directory: ${{ runner.temp }}
run: |
wget https://github.com/wxWidgets/wxWidgets/releases/download/v${{ env.WX_WIDGETS_VERSION }}/wxWidgets-${{ env.WX_WIDGETS_VERSION }}.tar.bz2
tar -xjf wxWidgets-${{ env.WX_WIDGETS_VERSION }}.tar.bz2
- name: Build wxwidgets
if: steps.wxwidgets-cache.outputs.cache-hit != 'true'
working-directory: ${{ runner.temp }}/wxWidgets-${{ env.WX_WIDGETS_VERSION }}
run: |
mkdir gtk-build
cd gtk-build
../configure
make -j2
build_wxwidgets_osx:
strategy:
matrix:
architecture: [ x86_64, arm64 ]
name: Build wxWidgets for OSX ${{ matrix.architecture }}
runs-on: macos-latest
timeout-minutes: 60
steps:
- name: Cache wxWidgets
uses: actions/cache@v4
id: wxwidgets-cache
with:
path: ${{ runner.temp }}/wxWidgets-${{ env.WX_WIDGETS_VERSION }}
key: ${{ runner.os }}-wxWidgets-${{ env.WX_WIDGETS_VERSION }}-${{ matrix.architecture }}
- name: Download wxWidgets
if: steps.wxwidgets-cache.outputs.cache-hit != 'true'
working-directory: ${{ runner.temp }}
run: |
wget https://github.com/wxWidgets/wxWidgets/releases/download/v${{ env.WX_WIDGETS_VERSION }}/wxWidgets-${{ env.WX_WIDGETS_VERSION }}.tar.bz2
tar -xjf wxWidgets-${{ env.WX_WIDGETS_VERSION }}.tar.bz2
- name: Build wxwidgets
if: steps.wxwidgets-cache.outputs.cache-hit != 'true'
working-directory: ${{ runner.temp }}/wxWidgets-${{ env.WX_WIDGETS_VERSION }}
run: |
mkdir build-static
cd build-static
../configure --disable-shared --disable-sys-libs --enable-unicode --enable-macosx_arch=${{ matrix.architecture }} --with-macosx-version-min=${{ env.TARGET_OSX_VERSION }}
make -j2
build_wxwidgets_windows:
name: Build wxWidgets for Windows
runs-on: windows-latest
timeout-minutes: 60
steps:
- name: Cache wxWidgets
uses: actions/cache@v4
id: wxwidgets-cache
with:
path: ${{ runner.temp }}\wxWidgets-${{ env.WX_WIDGETS_VERSION }}
key: ${{ runner.os }}-wxWidgets-${{ env.WX_WIDGETS_VERSION }}
- name: Install Dependencies
if: steps.wxwidgets-cache.outputs.cache-hit != 'true'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
install: >
git
base-devel
mingw-w64-i686-toolchain
unzip
- name: Download wxWidgets
if: steps.wxwidgets-cache.outputs.cache-hit != 'true'
working-directory: ${{ runner.temp }}
shell: msys2 {0}
run: |
mkdir wxWidgets-${{ env.WX_WIDGETS_VERSION }}
cd wxWidgets-${{ env.WX_WIDGETS_VERSION }}
wget -q https://github.com/wxWidgets/wxWidgets/releases/download/v${{ env.WX_WIDGETS_VERSION }}/wxWidgets-${{ env.WX_WIDGETS_VERSION }}.zip
unzip -q wxWidgets-${{ env.WX_WIDGETS_VERSION }}.zip
rm wxWidgets-${{ env.WX_WIDGETS_VERSION }}.zip
- name: Build wxWidgets
if: steps.wxwidgets-cache.outputs.cache-hit != 'true'
working-directory: ${{ runner.temp }}\wxWidgets-${{ env.WX_WIDGETS_VERSION }}\build\msw
shell: msys2 {0}
# NOTE: prebuilding setup.h using the setup_h tag allows the main build to use multiple cores
run: |
mingw32-make -f makefile.gcc SHARED=0 UNICODE=1 BUILD=release clean
mingw32-make -f makefile.gcc SHARED=0 UNICODE=1 BUILD=release setup_h
mingw32-make -j2 -f makefile.gcc SHARED=0 UNICODE=1 BUILD=release
# ############################################################################
# The build_<platform> jobs handle building Logo for each platform.
#
# Linux is run first as it produces the PDF for the other platform builds
# to use.
# ############################################################################
build_linux:
name: Build Logo for Linux
needs: [ build_wxwidgets_linux ]
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Update Package Info
run: |
sudo apt-get update
- name: Install Dependencies
run: >
sudo apt-get install
autoconf-archive
libgtk-3-dev
texlive
zip
- name: wxWidgets Cache
uses: actions/cache@v4
id: wxwidgets-cache
with:
path: ${{ runner.temp }}/wxWidgets-${{ env.WX_WIDGETS_VERSION }}
key: ${{ runner.os }}-wxWidgets-${{ env.WX_WIDGETS_VERSION }}
- name: Install wxwidgets
# Install wxwidgets from cache on build machine so autoconf has WX_CONFIG_CHECK
working-directory: ${{ runner.temp }}/wxWidgets-${{ env.WX_WIDGETS_VERSION }}
run: |
cd gtk-build
sudo make install
sudo cp ../wxwin.m4 /usr/share/aclocal/
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build Logo
run: |
autoreconf --install
./configure --enable-gitid
make -j2 dist
make -j2 dist-zip
- name: Archive ucblogo.tar.gz
uses: actions/upload-artifact@v4
with:
name: ucblogo.tar.gz
path: >
*.tar.gz
- name: Archive ucblogo.zip
uses: actions/upload-artifact@v4
with:
name: ucblogo.zip
path: >
*.zip
- name: Archive ucblogo.pdf
uses: actions/upload-artifact@v4
with:
name: ucblogo.pdf
path: docs/ucblogo.pdf
build_architecure_specific_osx:
strategy:
matrix:
architecture: [ x86_64, arm64 ]
name: Build Logo for OSX ${{ matrix.architecture }}
needs: [ build_wxwidgets_osx, build_linux ]
runs-on: macos-latest
timeout-minutes: 15
steps:
- name: Install Dependencies
run: >
brew install
autoconf-archive
automake
- name: wxWidgets Cache
uses: actions/cache@v4
id: wxwidgets-cache
with:
path: ${{ runner.temp }}/wxWidgets-${{ env.WX_WIDGETS_VERSION }}
key: ${{ runner.os }}-wxWidgets-${{ env.WX_WIDGETS_VERSION }}-${{ matrix.architecture }}
- name: Install wxwidgets
# Install wxwidgets from cache on build machine so autoconf has WX_CONFIG_CHECK
working-directory: ${{ runner.temp }}/wxWidgets-${{ env.WX_WIDGETS_VERSION }}
run: |
cd build-static
sudo make install
sudo cp ../wxwin.m4 /opt/homebrew/share/aclocal/
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download PDF manual
uses: actions/[email protected]
with:
name: ucblogo.pdf
path: docs
- name: Build Logo
env:
WX_CONFIG_PATH: ${{ runner.temp }}/wxWidgets-${{ env.WX_WIDGETS_VERSION }}/build-static/wx-config
CFLAGS: ${{ matrix.architecture == 'x86_64' && '-arch x86_64 -masm=intel' || '' }} -mmacosx-version-min=${{ env.TARGET_OSX_VERSION }}
CPPFLAGS: ${{ matrix.architecture == 'x86_64' && '-arch x86_64 -masm=intel' || '' }} -mmacosx-version-min=${{ env.TARGET_OSX_VERSION }}
CXXFLAGS: ${{ matrix.architecture == 'x86_64' && '-arch x86_64 -masm=intel' || '' }} -mmacosx-version-min=${{ env.TARGET_OSX_VERSION }}
LDFLAGS: ${{ matrix.architecture == 'x86_64' && '-arch x86_64 -masm=intel' || '' }} -mmacosx-version-min=${{ env.TARGET_OSX_VERSION }}
run: |
autoreconf --install
./configure --enable-gitid --with-wx-config=$WX_CONFIG_PATH
make -j2 ucblogo.dmg
- name: Archive ucblogo.dmg ${{ matrix.architecture }}
uses: actions/upload-artifact@v4
with:
name: ucblogo-${{ matrix.architecture }}.dmg
path: ucblogo.dmg
build_universal_binary_osx:
name: Build universal binary for OSX
needs: [ build_architecure_specific_osx ]
runs-on: macos-latest
timeout-minutes: 15
steps:
- name: Download PDF manual
uses: actions/[email protected]
with:
name: ucblogo.pdf
path: docs
- name: Download x86_64 disk image
uses: actions/[email protected]
with:
name: ucblogo-x86_64.dmg
path: ucblogo-x86_64
- name: Extract x86_64 application
run: |
hdiutil attach ucblogo-x86_64/ucblogo.dmg
cp -r /Volumes/UCBLogo/UCBLogo.app ucblogo-x86_64/UCBLogo.app
hdiutil detach /Volumes/UCBLogo
- name: Download arm64 disk image
uses: actions/[email protected]
with:
name: ucblogo-arm64.dmg
path: ucblogo-arm64
- name: Extract arm64 application
run: |
hdiutil attach ucblogo-arm64/ucblogo.dmg
cp -r /Volumes/UCBLogo/UCBLogo.app ucblogo-arm64/UCBLogo.app
hdiutil detach /Volumes/UCBLogo
- name: Build universal application
run: |
lipo -create -output ucblogo ucblogo-x86_64/UCBLogo.app/Contents/MacOS/UCBLogo ucblogo-arm64/UCBLogo.app/Contents/MacOS/UCBLogo
cp -r ucblogo-arm64/UCBLogo.app UCBLogo.app
cp ucblogo UCBLogo.app/Contents/MacOS/UCBLogo
- name: Build Logo disk image
run: |
hdiutil create -size 20m -fs HFS+ -volname "UCBLogo" ucblogo_base.dmg
hdiutil attach ucblogo_base.dmg
cp -a UCBLogo.app /Volumes/UCBLogo/
cp docs/ucblogo.pdf /Volumes/UCBLogo/UCBLogoUserManual.pdf
hdiutil detach /Volumes/UCBLogo/
hdiutil convert ucblogo_base.dmg -format UDZO -o ucblogo.dmg
- name: Archive universal ucblogo.dmg
uses: actions/upload-artifact@v4
with:
name: ucblogo.dmg
path: ucblogo.dmg
build_windows:
name: Build Logo for Windows
needs: [ build_wxwidgets_windows, build_linux ]
runs-on: windows-latest
timeout-minutes: 15
steps:
- name: Install Dependencies
uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
install: >
git
base-devel
mingw-w64-i686-toolchain
unzip
- name: wxWidgets Cache
uses: actions/cache@v4
id: wxwidgets-cache
with:
path: ${{ runner.temp }}\wxWidgets-${{ env.WX_WIDGETS_VERSION }}
key: ${{ runner.os }}-wxWidgets-${{ env.WX_WIDGETS_VERSION }}
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Prepare Repository
shell: msys2 {0}
run: |
git clean -x -d -f .
mingw32-make -f makefile.msys git.c
rm libloc.c
- name: Download PDF manual
uses: actions/[email protected]
with:
name: ucblogo.pdf
path: docs
- name: Find MinGW bin directory
shell: msys2 {0}
run: |
echo "MINGW_BIN_DIR=`dirname $(command -v gcc)`" >> $GITHUB_ENV
- name: Build Logo
shell: msys2 {0}
env:
WX_DIR: ${{ runner.temp }}\wxWidgets-${{ env.WX_WIDGETS_VERSION }}
run: |
mingw32-make -f makefile.msys MINGW_BIN_DIR=$MINGW_BIN_DIR WX_DIR=$WX_DIR install_win
- name: Run Inno
working-directory: ${{ github.workspace }}\inno
shell: pwsh
run: |
iscc ucblogo.iss
- name: Archive installer
uses: actions/upload-artifact@v4
with:
name: ucblogosetup.exe
path: inno/ucblogo*setup.exe