Skip to content

Commit

Permalink
Misc: update github actions (#2445)
Browse files Browse the repository at this point in the history
  • Loading branch information
lixun910 committed Aug 17, 2023
1 parent 65c8c4a commit 8095b6d
Show file tree
Hide file tree
Showing 12 changed files with 290 additions and 144 deletions.
48 changes: 38 additions & 10 deletions .github/workflows/osx_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,59 @@ jobs:

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install application certificate
uses: apple-actions/import-codesign-certs@v1
uses: apple-actions/import-codesign-certs@v2
with:
keychain: ${{ github.run_id }}
keychain-password: ${{ github.run_id }}
p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }}
p12-password: ${{ secrets.MACOS_CERTIFICATE_PWD }}

# Build GeoDa
- name: Build GeoDa
- name: Setup Brew
run: |
brew install [email protected]
ln -s /usr/local/opt/[email protected] /usr/local/opt/boost
brew install gdal
- uses: actions/cache@v3
id: cache
with:
path: |
BuildTools/macosx/libraries
BuildTools/macosx/temp
key: ${{ runner.os }}-deps-cache-${{ hashFiles('BuildTools/macosx/install.sh') }}

- if: steps.cache.outputs.cache-hit != 'true'
name: Build Dependencies
run: |
cp GeoDamake.macosx.opt GeoDamake.opt
cd BuildTools
cd macosx
cd BuildTools/macosx
export GEODA_HOME=$PWD
export GEODA_ARCH=x86_64
./install.sh
- name: Build GeoDa
run: |
mkdir -p o
cd BuildTools/macosx
export GEODA_HOME=$PWD
cp ../../GeoDamake.macosx.opt ../../GeoDamake.opt
echo "find identity"
security find-identity -v
echo "start installing..."
./install.sh
VER_MAJOR=$(grep version_major $GEODA_HOME/../../version.h | sed -e 's/^[[:space:]][[:alpha:]|[:space:]|_|=]*//g' | sed -e 's/;//g')
VER_MINOR=$(grep version_minor $GEODA_HOME/../../version.h | sed -e 's/^[[:space:]][[:alpha:]|[:space:]|_|=]*//g' | sed -e 's/;//g')
VER_BUILD=$(grep version_build $GEODA_HOME/../../version.h | sed -e 's/^[[:space:]][[:alpha:]|[:space:]|_|=]*//g' | sed -e 's/;//g')
GEODA_VERSION=$VER_MAJOR.$VER_MINOR.$VER_BUILD
echo $GEODA_VERSION
make -j$(sysctl -n hw.ncpu)
make app
cd create-dmg
./geoda.sh $GEODA_VERSION
codesign --timestamp -s "Developer ID Application: Geodapress LLC (26M5NG43GP)" -i edu.uchicago.spatial GeoDa$GEODA_VERSION-Installer.dmg
# Upload artifact
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: GeoDa-${{ env.GEODA_VER }}-MacOS
path: ${{ github.workspace }}/BuildTools/macosx/create-dmg/GeoDa${{ env.GEODA_VER }}-Installer.dmg
48 changes: 37 additions & 11 deletions .github/workflows/ubuntu_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ jobs:
# This workflow contains a single job called "build"
ubuntu_build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
runs-on: ${{ matrix.distro }}
if: ${{ !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') }}

strategy:
fail-fast: true
matrix:
distro:
- 'ubuntu:18.04'
- 'ubuntu:20.04'
- 'ubuntu-22.04'
- 'ubuntu-20.04'
include:
- distro: 'ubuntu:18.04'
pre: 'bionic'
- distro: 'ubuntu:20.04'
- distro: 'ubuntu-22.04'
pre: 'jammy'
- distro: 'ubuntu-20.04'
pre: 'focal'

env:
Expand All @@ -45,22 +45,48 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v3

# Prepare
- name: Prepare on ${{ matrix.distro }}
run: |
chmod +x BuildTools/ubuntu/create_deps.sh
chmod +x BuildTools/ubuntu/install.sh
mkdir -p o
chmod 644 o
echo ${{ env.TARGET_OS }}
- uses: actions/cache@v3
id: cache
with:
path: |
BuildTools/ubuntu/libraries
BuildTools/ubuntu/temp
key: ${{ runner.os }}-${{ env.TARGET_OS }}-deps-cache-${{ hashFiles('BuildTools/ubuntu/create_deps.sh') }}

# Create Deps
- if: steps.cache.outputs.cache-hit != 'true'
name: Create Dependencies
run: |
export WORK_DIR=$PWD
export OS=${{ env.TARGET_OS }}
export VER=${{ env.GEODA_VER }}
export APT="sudo apt-get"
cd BuildTools/ubuntu
./create_deps.sh
# Build GeoDa
- name: Build GeoDa
run: docker run --privileged=true -e CI -e WORK_DIR="$PWD" -e CURL_CA_BUNDLE="/etc/ssl/certs/ca-certificates.crt" -e OS=${{ env.TARGET_OS }} -e VER=${{ env.GEODA_VER }} -e APT="apt-get" -v $PWD:$PWD -v /var/run/docker.sock:/var/run/docker.sock ${{ matrix.distro }} $PWD/BuildTools/ubuntu/install.sh
run: |
mkdir -p o
chmod 755 o
export WORK_DIR=$PWD
export OS=${{ env.TARGET_OS }}
export VER=${{ env.GEODA_VER }}
export APT="sudo apt-get"
cd BuildTools/ubuntu
./install.sh
# Upload artifact
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: GeoDa-${{ env.GEODA_VER }}-${{ env.TARGET_OS }}
path: ${{ github.workspace }}/BuildTools/ubuntu/geoda_${{ env.GEODA_VER }}-1${{ env.TARGET_OS }}1_amd64.deb
53 changes: 43 additions & 10 deletions .github/workflows/windows_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v3

# Set environment
- name: Set environment
Expand Down Expand Up @@ -81,8 +81,17 @@ jobs:
echo ::set-env name=LIB::%LIB%
echo ::set-env name=LIBPATH::%LIBPATH%
# Build GeoDa
- name: Build
- uses: actions/cache@v3
id: cache
with:
path: |
BuildTools/windows/libraries
BuildTools/windows/temp
key: ${{ runner.os }}-${{ matrix.platform }}-deps-cache-${{ hashFiles('BuildTools/windows/deps.md') }}

# Create Deps
- if: steps.cache.outputs.cache-hit != 'true'
name: Create Dependencies
shell: pwsh
run: |
$ErrorActionPreference = 'continue'
Expand Down Expand Up @@ -206,16 +215,40 @@ jobs:
7z x OpenCL.zip
dir
cd ..
#
# GeoDa
#
# Build GeoDa
- name: Build GeoDa
shell: pwsh
run: |
function exec
{
param ( [ScriptBlock] $ScriptBlock )
& $ScriptBlock 2>&1 | ForEach-Object -Process { "$_" }
if ($LastExitCode -ne 0) { exit $LastExitCode }
}
echo "ARCH_FLAGS = $env:ARCH_FLAGS"
Import-PackageProvider NuGet -Force
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
# install pscx powershell and vSSetup
Install-Module Pscx -AllowClobber
Install-Module VSSetup -Scope CurrentUser
if($env:VS_VER -eq "2019")
{
}
else
{
Import-VisualStudioVars -VisualStudioVersion $env:VS_VER -Architecture $env:ARCHITECTURE
}
$ErrorActionPreference = 'continue'
$env:GDA_PATH="$env:GITHUB_WORKSPACE\BuildTools\windows"
cd $env:GDA_PATH
if($env:platform -eq "x86")
{
msbuild.exe GeoDa.vs2019.sln /t:GeoDa /property:Configuration="Release" /p:Platform="Win32"
msbuild.exe GeoDa.vs2019.sln /t:GeoDa /property:Configuration="Release" /m /p:Platform="Win32"
}
else
{
msbuild.exe GeoDa.vs2019.sln /t:GeoDa /property:Configuration="Release" /p:Platform="x64"
msbuild.exe GeoDa.vs2019.sln /t:GeoDa /property:Configuration="Release" /m /p:Platform="x64"
}
#
# InnoSetup
Expand All @@ -236,12 +269,12 @@ jobs:
}
dir
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: GeoDa-Windows-${{ env.platform }}-installer
path: ${{ github.workspace }}\BuildTools\windows\GeoDa_1.22_${{ env.platform }}_Setup.exe

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: GeoDa-Windows7+-${{ env.platform }}-installer
path: ${{ github.workspace }}\BuildTools\windows\GeoDa_1.22_win7+${{ env.platform }}_Setup.exe
6 changes: 6 additions & 0 deletions BuildTools/macosx/code_sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def ProcessDependency(dylib_path, cid):
dylib_path = '/opt/homebrew/opt/geos/lib/libgeos.3.11.0.dylib'
if dylib_path == '@rpath/libgeos.3.11.2.dylib':
dylib_path = '/opt/homebrew/opt/geos/lib/libgeos.3.11.2.dylib'
if dylib_path == '@rpath/libgeos.3.12.2.dylib':
dylib_path = '/opt/homebrew/opt/geos/lib/libgeos.3.12.2.dylib'
if dylib_path == '@loader_path/libicuuc.71.dylib':
dylib_path = '/opt/homebrew/opt/icu4c/lib/libicuuc.71.dylib'
if dylib_path == '@loader_path/libicuuc.72.dylib':
Expand Down Expand Up @@ -47,6 +49,10 @@ def ProcessDependency(dylib_path, cid):
dylib_path = '/usr/local/opt/openexr/lib/libOpenEXR-3_1.30.dylib'
if dylib_path == '@rpath/libOpenEXRCore-3_1.30.dylib':
dylib_path = '/usr/local/opt/openexr/lib/libOpenEXRCore-3_1.30.dylib'

m = re.search('@rpath/(libabsl.*)', dylib_path)
if m:
dylib_path = '/usr/local/opt/abseil/lib/' + m.group(1)

m = re.search('@rpath/(libaws.*)', dylib_path)
if m:
Expand Down
37 changes: 19 additions & 18 deletions BuildTools/macosx/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ set -e

export GEODA_HOME=$PWD
echo $GEODA_HOME
CPUS=2
CPUS=`sysctl -n hw.ncpu`

# Install boost 1.75
brew install [email protected]
ln -s /usr/local/opt/[email protected] /usr/local/opt/boost
#brew install [email protected]
#ln -s /usr/local/opt/[email protected] /usr/local/opt/boost

# Install libgdal 3.6
brew install gdal
#brew install gdal

cd $GEODA_HOME
mkdir -p temp
Expand All @@ -21,6 +21,8 @@ mkdir -p libraries/lib
mkdir -p libraries/include
mkdir -p ../../o

cd temp

# FIX for libgdal on Monterey using sqlite 3.30.1
# cd temp
# curl -L -O https://sqlite.org/2019/sqlite-autoconf-3300100.tar.gz
Expand All @@ -33,7 +35,6 @@ mkdir -p ../../o
# cd ..

# Build wxWidgets 3.1.4
cd temp
if ! [ -f "wxWidgets-3.1.4.tar.bz2" ]; then
curl -L -O https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.4/wxWidgets-3.1.4.tar.bz2
tar -xf wxWidgets-3.1.4.tar.bz2
Expand Down Expand Up @@ -94,19 +95,19 @@ if ! [ -f "v0.8.0.zip" ]; then
mv spectra-0.8.0 spectra
fi

# Build GeoDa
cd ..
cp ../../GeoDamake.macosx.opt ../../GeoDamake.opt
make -j $CPUS
make app
# Build GeoDa
# cp ../../GeoDamake.macosx.opt ../../GeoDamake.opt
# make -j $CPUS
# make app

# Create dmg
VER_MAJOR=$(grep version_major $GEODA_HOME/../../version.h | sed -e 's/^[[:space:]][[:alpha:]|[:space:]|_|=]*//g' | sed -e 's/;//g')
VER_MINOR=$(grep version_minor $GEODA_HOME/../../version.h | sed -e 's/^[[:space:]][[:alpha:]|[:space:]|_|=]*//g' | sed -e 's/;//g')
VER_BUILD=$(grep version_build $GEODA_HOME/../../version.h | sed -e 's/^[[:space:]][[:alpha:]|[:space:]|_|=]*//g' | sed -e 's/;//g')
GEODA_VERSION=$VER_MAJOR.$VER_MINOR.$VER_BUILD
echo $GEODA_VERSION
# # Create dmg
# VER_MAJOR=$(grep version_major $GEODA_HOME/../../version.h | sed -e 's/^[[:space:]][[:alpha:]|[:space:]|_|=]*//g' | sed -e 's/;//g')
# VER_MINOR=$(grep version_minor $GEODA_HOME/../../version.h | sed -e 's/^[[:space:]][[:alpha:]|[:space:]|_|=]*//g' | sed -e 's/;//g')
# VER_BUILD=$(grep version_build $GEODA_HOME/../../version.h | sed -e 's/^[[:space:]][[:alpha:]|[:space:]|_|=]*//g' | sed -e 's/;//g')
# GEODA_VERSION=$VER_MAJOR.$VER_MINOR.$VER_BUILD
# echo $GEODA_VERSION

cd create-dmg
./geoda.sh $GEODA_VERSION
codesign --timestamp -s "Developer ID Application: Geodapress LLC (26M5NG43GP)" -i edu.uchicago.spatial GeoDa$GEODA_VERSION-Installer.dmg
# cd create-dmg
# ./geoda.sh $GEODA_VERSION
# codesign --timestamp -s "Developer ID Application: Geodapress LLC (26M5NG43GP)" -i edu.uchicago.spatial GeoDa$GEODA_VERSION-Installer.dmg
14 changes: 14 additions & 0 deletions BuildTools/macosx/install_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def ProcessDependency(dir_path, dylib_name):
copyitem = '/usr/local/opt/geos/lib/libgeos.dylib'
if item == '@rpath/libgeos.3.11.0.dylib':
copyitem = '/usr/local/opt/geos/lib/libgeos.dylib'
if item == '@rpath/libgeos.3.12.0.dylib':
copyitem = '/usr/local/opt/geos/lib/libgeos.dylib'
if item == '@rpath/libgeos.3.11.1.dylib':
copyitem = '/usr/local/opt/geos/lib/libgeos.dylib'
if item == '@rpath/libgeos.3.11.2.dylib':
Expand Down Expand Up @@ -51,7 +53,19 @@ def ProcessDependency(dir_path, dylib_name):
copyitem = '/usr/local/opt/openexr/lib/libOpenEXR-3_1.30.dylib'
if item == '@rpath/libOpenEXRCore-3_1.30.dylib':
copyitem = '/usr/local/opt/openexr/lib/libOpenEXRCore-3_1.30.dylib'
if item == '@rpath/libabsl_log_internal_conditions.2301.0.0.dylib':
copyitem = '/usr/local/opt/abseil/lib/libabsl_log_internal_conditions.2301.0.0.dylib'
if item == '@rpath/libabsl_raw_logging_internal.2301.0.0.dylib':
copyitem = '/usr/local/opt/abseil/lib/libabsl_raw_logging_internal.2301.0.0.dylib'
if item == '@rpath/libabsl_log_severity.2301.0.0.dylib':
copyitem = '/usr/local/opt/abseil/lib/libabsl_log_severity.2301.0.0.dylib'
if item == '@rpath/libabsl_base.2301.0.0.dylib':
copyitem = '/usr/local/opt/abseil/lib/libabsl_base.2301.0.0.dylib'

m = re.search('@rpath/(libabsl.*)', item)
if m:
copyitem = '/usr/local/opt/abseil/lib/' + m.group(1)

m = re.search('@rpath/(libaws.*)', item)
if m:
copyitem = '/usr/local/opt/aws-sdk-cpp/lib/' + m.group(1)
Expand Down
2 changes: 1 addition & 1 deletion BuildTools/ubuntu/create_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [[ $MACHINE_TYPE != 'x86_64' ]]; then
fi

if [[ $# -ne 2 ]]; then
echo "create_deb.sh bionic|disco|xenial 1.22"
echo "create_deb.sh focal|jammy 1.22"
exit
fi

Expand Down
Loading

0 comments on commit 8095b6d

Please sign in to comment.