Skip to content

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
benkuper committed Oct 19, 2023
1 parent ea1980d commit c4ad804
Show file tree
Hide file tree
Showing 50 changed files with 49,789 additions and 163 deletions.
12 changes: 6 additions & 6 deletions .github/actions/set-suffix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ runs:
if [[ $GITHUB_REF == *"refs/tags/"* ]]
then
echo "Found Tag : ${GITHUB_REF#refs/tags/}"
echo "::set-output name=suffix::${{ inputs.os }}-${GITHUB_REF#refs/tags/}"
echo "::set-output name=config::Release"
echo "::set-output name=dep::release"
echo "suffix=${{ inputs.os }}-${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
echo "config=Release" >> $GITHUB_OUTPUT
echo "dep=release" >> $GITHUB_OUTPUT
else
echo "::set-output name=suffix::${{ inputs.os }}-bleedingedge"
echo "::set-output name=config::Release"
echo "::set-output name=dep::release"
echo "suffix=${{ inputs.os }}-bleedingedge" >> $GITHUB_OUTPUT
echo "config=Release" >> $GITHUB_OUTPUT
echo "dep=release" >> $GITHUB_OUTPUT
fi
shell: bash
227 changes: 148 additions & 79 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ env:
jobs:
windows:
name: Windows
#if: false # always skip job (heap space needs fix)
runs-on: windows-2019
# if: false # always skip job
runs-on: windows-2022
strategy:
matrix:
include:
- arch: win-x64
buildFolder: "VisualStudio2019_CI"
buildFolder: "VisualStudio2022_CI"
installerName: install

fail-fast: false

steps:
Expand Down Expand Up @@ -43,9 +43,9 @@ jobs:
- name: Force 64-bit Linker
shell: powershell
run: |
cmd.exe /c "call `"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat`" && set > %temp%\vcvars.txt"
cmd.exe /c "call `"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat`" && set > %temp%\vcvars.txt"
Get-Content "$env:temp\vcvars.txt" | Foreach-Object { if ($_ -match "^(.*?)=(.*)$") { Set-Content "env:\$($matches[1])" $matches[2] }}
- name: Build
run: msbuild "Builds/${{ matrix.buildFolder }}/${{ env.ProjectName }}.sln" /p:PreferredToolArchitecture=x64 /m /verbosity:normal /p:Configuration=${{ steps.set_variables.outputs.config }}

Expand All @@ -57,8 +57,8 @@ jobs:
Invoke-WebRequest "${{ secrets.DEPDIRURL }}${{ env.ProjectName }}-win-x64-${{ steps.set_variables.outputs.dep }}-dependencies.zip" -OutFile ./deps.zip
7z e deps.zip -aoa
&"C:/Program Files (x86)/Inno Setup 6/ISCC.exe" "${{ github.workspace }}/${{ matrix.installerName }}.iss" /O. /F$PKGNAME
echo "::set-output name=pkg-name::$PKGNAME.exe"
echo "::set-output name=pdb-name::$PKGNAME.pdb"
echo "pkg-name=$PKGNAME.exe" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
echo "pdb-name=$PKGNAME.pdb" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
working-directory: ./Binaries/CI/App

- name: Upload
Expand All @@ -77,18 +77,30 @@ jobs:
working-directory: ./Builds/${{ matrix.buildFolder }}/x64/${{ steps.set_variables.outputs.config }}/App

- name: Upload PDB
if: false #force no upload for Bento right now
#if: ${{ steps.set_variables.outputs.config == 'Release' && matrix.arch == 'win-x64' }}
if: ${{ steps.set_variables.outputs.config == 'Release' && matrix.arch == 'win-x64' }}
uses: ./.github/actions/upload
with:
pkg-name: ./Builds/${{ matrix.buildFolder }}/x64/${{ steps.set_variables.outputs.config }}/App/${{ steps.create_package.outputs.pdb-name }}
url: ${{ secrets.PDBUPLOADURL }}
pass: ${{ secrets.UPLOADPASS }}

osx:
#if: false # tmp disable
# if: false # tmp disable
name: OSX
runs-on: macos-latest

strategy:
matrix:
include:
- arch: x86_64
suffix: intel
config: Release

- arch: arm64
suffix: silicon
config: ReleaseSilicon

fail-fast: false

steps:
- name: Checkout repo
Expand All @@ -107,7 +119,7 @@ jobs:
id: set_variables
uses: ./.github/actions/set-suffix
with:
os: 'osx'
os: 'osx-${{ matrix.suffix }}'

- name: Download Packages
run: |
Expand All @@ -117,13 +129,14 @@ jobs:
hdiutil detach "/Volumes/Packages ${{ env.PackagesVersion }}/"
- name: Build
uses: sersoft-gmbh/xcodebuild-action@v1.3
uses: sersoft-gmbh/xcodebuild-action@v2.0.1
with:
project: Builds/MacOSX_CI/${{ env.ProjectName }}.xcodeproj
destination: platform=macOS
jobs: 2
action: build
configuration: Release
arch: ${{ matrix.arch }}
configuration: ${{ matrix.config }}
use-xcpretty: true

- name: Create Package
Expand All @@ -132,7 +145,7 @@ jobs:
packagesbuild ${{ env.ProjectName }}.pkgproj
PKGNAME=${{ env.ProjectName }}-${{ steps.set_variables.outputs.suffix }}.pkg
mv ${{ env.ProjectName }}.pkg $PKGNAME
echo "::set-output name=pkg-name::$PKGNAME"
echo "pkg-name=$PKGNAME" >> $GITHUB_OUTPUT
working-directory: ./Package

- name: Upload
Expand All @@ -143,19 +156,11 @@ jobs:
pass: ${{ secrets.UPLOADPASS }}

linux:
#if: false # tmp disable
# if: false # tmp disable

name: Linux
runs-on: ubuntu-18.04
strategy:
matrix:
include:
- arch: linux-x64
buildFolder: "LinuxMakefile"

- arch: linux-armhf
buildFolder: "Raspberry"
fail-fast: false
runs-on: ubuntu-22.04
container: tommagnier/chataigne-linux-x64-build

steps:
- name: Checkout repo
Expand All @@ -174,65 +179,39 @@ jobs:
id: set_variables
uses: ./.github/actions/set-suffix
with:
os: ${{ matrix.arch }}
os: 'x64'

- name: Installing dependencies
id: install_deps
#shell: bash {0} # Opt out of fail-fast behavior (necessary to ignore fetch errors)
run: |
echo "Target system architecture: ${{ matrix.arch }}"
if [ "${{ matrix.arch }}" == "linux-armhf" ];
then
sudo tee /etc/apt/sources.list << END
deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb [arch=amd64] http://security.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe multiverse
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted universe multiverse
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse
END
sudo dpkg --add-architecture armhf
sudo apt-get update
echo "Installing armhf cross compilation tools"
sudo apt-get install -qy g++-arm-linux-gnueabihf
echo "Installing extra lib dependencies"
sudo apt-get install -qyf libgdk-pixbuf2.0-dev:armhf libpango1.0-dev:armhf libsoup2.4-dev:armhf libharfbuzz-dev:armhf libxml2-dev:armhf libicu-dev:armhf libc6-dev:armhf libxft-dev:armhf
echo "Downloading AppImage runtime for armhf"
cd ${{ github.workspace }}
wget "https://github.com/AppImage/AppImageKit/releases/download/12/runtime-armhf"
echo "::set-output name=appImageRuntime::--runtime-file ${{ github.workspace }}/runtime-armhf"
# DEP_ARCH is used later when downloading the dependencies
DEP_ARCH="armhf"
fi
sudo apt-get update
echo "Installing JUCE lib dependencies and extra tools"
sudo apt-get install -qyf libfreetype6-dev:$DEP_ARCH libx11-dev:$DEP_ARCH libxinerama-dev:$DEP_ARCH libxrandr-dev:$DEP_ARCH libxcursor-dev:$DEP_ARCH libxcomposite-dev:$DEP_ARCH mesa-common-dev:$DEP_ARCH libasound2-dev:$DEP_ARCH freeglut3-dev:$DEP_ARCH libcurl4-gnutls-dev:$DEP_ARCH libasound2-dev:$DEP_ARCH libjack-dev:$DEP_ARCH libbluetooth-dev:$DEP_ARCH libgtk-3-dev:$DEP_ARCH libwebkit2gtk-4.0-dev:$DEP_ARCH libsdl2-dev:$DEP_ARCH libfuse2:$DEP_ARCH libusb-1.0-0-dev:$DEP_ARCH libhidapi-dev:$DEP_ARCH
sudo apt-get install -qy curl
# Most dependencies are already installed in the Docker image. Uncomment the following lines if you need more
# apt-get update && apt-get install ...
cd ${{ github.workspace }}
wget "https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage"
cd $GITHUB_WORKSPACE
wget "https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage"
chmod a+x appimagetool-x86_64.AppImage
# - name: Start SSH via ngrok
# uses: P3TERX/ssh2actions@main
# with:
# mode: ngrok
# env:
# # After sign up on the https://ngrok.com
# # You can find this token here: https://dashboard.ngrok.com/auth/your-authtoken
# NGROK_TOKEN: ${{ secrets.NGROK_TOKEN }}

# # ngrok server region [us, eu, au, ap, sa, jp, in] (optional, default: us)
# # You can find this server region here: https://ngrok.com/docs#global-locations
# NGROK_REGION: us

# # This password you will use when authorizing via SSH
# SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }}

- name: Build
run: |
if [ "${{ matrix.arch }}" == "linux-armhf" ];
then
export CXX=arm-linux-gnueabihf-g++
export CC=arm-linux-gnueabihf-gcc
export PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig
export TARGET_ARCH="-march=armv8-a" # TARGET_ARCH is used in the Makefile
fi
cd ${{ github.workspace }}/Builds/${{ matrix.buildFolder }}
cd $GITHUB_WORKSPACE/Builds/LinuxMakefile
gcc --version
make -j2 CONFIG=Release
- name: Create AppImage
Expand All @@ -241,14 +220,104 @@ jobs:
mkdir -p ${{ env.ProjectName }}.AppDir/usr/bin/
cp build/${{ env.ProjectName }} ${{ env.ProjectName }}.AppDir/usr/bin/
PKGNAME=${{ env.ProjectName }}-${{ steps.set_variables.outputs.suffix }}.AppImage
echo "::set-output name=pkg-name::$PKGNAME"
${{ github.workspace }}/appimagetool-x86_64.AppImage ${{ steps.install_deps.outputs.appImageRuntime }} ${{ env.ProjectName }}.AppDir $PKGNAME
PKGNAME=${{ env.ProjectName }}-linux-${{ steps.set_variables.outputs.suffix }}.AppImage
echo "pkg-name=$PKGNAME" >> $GITHUB_OUTPUT
$GITHUB_WORKSPACE/appimagetool-x86_64.AppImage --appimage-extract-and-run ${{ env.ProjectName }}.AppDir $PKGNAME
working-directory: ./Builds/LinuxMakefile

- name: Upload
uses: ./.github/actions/upload
with:
pkg-name: ./Builds/LinuxMakefile/${{ steps.create_package.outputs.pkg-name }}
url: ${{ secrets.UPLOADURL }}
pass: ${{ secrets.UPLOADPASS }}

raspberrypi:
# if: false # tmp disable

name: Raspberry Pi
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- arch: armhf
cpu: arm1176 #suitable for all Pi versions
base_image: raspios_lite:2021-05-07
cpu_info: raspberrypi_zero_w
buildFolder: "Raspberry"
buildConfig: "Release"

- arch: aarch64
cpu: cortex-a53
base_image: raspios_lite_arm64:2022-04-04
cpu_info: raspberrypi_zero2_w_arm64_w
buildFolder: "Raspberry64"
buildConfig: "Release"

fail-fast: false

steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: 'recursive'

- name: Checkout JUCE
uses: actions/checkout@v2
with:
repository: benkuper/JUCE
ref: develop-local
path: JUCE

- name: Set Suffix
id: set_variables
uses: ./.github/actions/set-suffix
with:
os: ${{ matrix.arch }}

- name: Download and prepare AppImage
run: |
sudo apt-get update
sudo apt-get install libfuse2 # required on ubuntu 22.04
wget "https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage"
chmod a+x appimagetool-x86_64.AppImage
echo "Downloading AppImage runtime for ${{ matrix.arch }}"
wget "https://github.com/AppImage/AppImageKit/releases/download/13/runtime-${{ matrix.arch }}"
mkdir -p ./Builds/${{ matrix.buildFolder }}/${{ env.ProjectName }}.AppDir/usr/bin/
working-directory: ${{ github.workspace }}

- name: Install dependencies and build
id: build
uses: pguyot/arm-runner-action@v2
with:
image_additional_mb: 2048
base_image: ${{ matrix.base_image }}
cpu: ${{ matrix.cpu }}
copy_artifact_path: Builds/${{ matrix.buildFolder }}/build/${{ env.ProjectName }}
copy_artifact_dest: Builds/${{ matrix.buildFolder }}/${{ env.ProjectName }}.AppDir/usr/bin/
commands: |
apt-get update
echo "Installing JUCE lib dependencies and extra tools"
apt-get install -qyf libcurl3-gnutls libfreetype6-dev libx11-dev libxinerama-dev libxrandr-dev libxcursor-dev libxcomposite-dev mesa-common-dev libasound2-dev freeglut3-dev libcurl4-gnutls-dev libasound2-dev libjack-dev libbluetooth-dev libgtk-3-dev libwebkit2gtk-4.0-dev libsdl2-dev libusb-1.0-0-dev libhidapi-dev ladspa-sdk libssl-dev
apt-get install -qy curl
cd Builds/${{ matrix.buildFolder }}
make -j2 CONFIG=${{ matrix.buildConfig }}
- name: Create AppImage
id: create_package
run: |
PKGNAME=${{ env.ProjectName }}-linux-${{ steps.set_variables.outputs.suffix }}.AppImage
echo "pkg-name=$PKGNAME" >> $GITHUB_OUTPUT
${{ github.workspace }}/appimagetool-x86_64.AppImage --runtime-file ${{ github.workspace }}/runtime-${{ matrix.arch }} ${{ env.ProjectName }}.AppDir $PKGNAME
working-directory: ./Builds/${{ matrix.buildFolder }}

- name: Upload
uses: ./.github/actions/upload
with:
pkg-name: ./Builds/${{ matrix.buildFolder }}/${{ steps.create_package.outputs.pkg-name }}
url: ${{ secrets.UPLOADURL }}
pass: ${{ secrets.UPLOADPASS }}
pass: ${{ secrets.UPLOADPASS }}
Loading

0 comments on commit c4ad804

Please sign in to comment.