Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download libs script update (adds #7907 wget2) - params and fixes deploy logs #8002

Merged
merged 34 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a18d211
downloader in parallel
dimitre Mar 10, 2024
f005cae
Update download_libs.sh - parallel downloads
dimitre Mar 10, 2024
e04096f
wget2 changes downloader fixes
danoli3 May 27, 2024
2353c49
Updated downloader script to support changes for parellel downloads, …
danoli3 May 27, 2024
3620d06
downloader fix up URLs parellel
danoli3 May 27, 2024
4ef1e19
Downloader fix parallel curl - add commands
danoli3 May 27, 2024
c6bb1ff
Apothecary Fix up commands
danoli3 May 27, 2024
b8d9f50
Download script osx - no need to send -a causing double download
danoli3 May 27, 2024
09020a4
Downloader updates
danoli3 May 28, 2024
f7b2242
cURL Test Ci
danoli3 May 28, 2024
e9196eb
wget og Ci test
danoli3 May 28, 2024
d6c18c5
wget2 Ci Test / SSL off
danoli3 May 28, 2024
9412439
download libs ci just BITS target
danoli3 May 28, 2024
cdd123e
ci focused VS bits off for the moment
danoli3 May 28, 2024
9159f2f
ci test downloader --silent
danoli3 May 28, 2024
fe206d3
Download libs fix arch
danoli3 May 28, 2024
7effbff
Download script v3.0.1 - fixes for cURL in silent mode
danoli3 May 29, 2024
a9125b9
Download_libs fixed Overwrite
danoli3 May 29, 2024
253b2eb
downloader 3.1.0 wget/wget2 - now checks remote file vs local if foun…
danoli3 May 29, 2024
ff0f905
download_libs 2.1 -
danoli3 May 29, 2024
55ccce0
download_libs - set PLATFORM to target if set
danoli3 May 29, 2024
65d0631
downloader 3.1.1 - fixes for cURL - no ssl fixed
danoli3 May 30, 2024
21ffcf1
github actions workflow fix for concurrency in PRs being cancelled by…
danoli3 May 30, 2024
7e5671d
cURL optimisation with remote and local file check. Using HEAD flags …
danoli3 May 30, 2024
fa9f606
github actions cleanup cache
danoli3 May 30, 2024
e6c3c09
Linux Cache off
danoli3 May 30, 2024
67aa4b4
apt-get broken for ssl-dev
danoli3 May 30, 2024
aba377c
no cache on libssl
danoli3 May 30, 2024
6ead937
cache remove ssl/curl
danoli3 May 30, 2024
401e195
chmod +x for msys2
danoli3 May 30, 2024
7576f67
cache disable for linux
danoli3 May 30, 2024
c61f209
linux cache?
danoli3 May 30, 2024
ca424e4
ubuntu-22.04
danoli3 May 30, 2024
b8d4116
Downloader 3.2.1 - wget2 re-enabled default if available
danoli3 May 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/actions/build-vs2022.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
git
unzip
rsync
wget2
wget
- name: Install dependencies
shell: msys2 {0}
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/clean-up-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: cleanup caches by a branch
on:
pull_request:
types:
- closed

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/of.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- 'examples/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

env:
Expand Down Expand Up @@ -201,7 +201,7 @@ jobs:
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

build-linux64:
runs-on: ubuntu-24.04
runs-on: ubuntu-22.04
strategy:
matrix:
cfg:
Expand All @@ -216,7 +216,7 @@ jobs:
- name: Cache Packages
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: aptitude aptitude-common libboost-iostreams1.83.0 libcwidget4 libsigc++-2.0-0v5 libxapian30 fonts-wine{a} libasound2-plugins{a} libcapi20-3t64{a} libosmesa6{a} libpcsclite1{a} libspeexdsp1{a} libwine{a} libxkbregistry0{a} libz-mingw-w64{a} wine{a} wine64 wget2 make curl libjack-jackd2-0 libjack-jackd2-dev freeglut3-dev libasound2-dev libxmu-dev libxxf86vm-dev g++ libgl1-mesa-dev libglu1-mesa-dev libraw1394-dev libudev-dev libdrm-dev libglew-dev libopenal-dev libsndfile1-dev libfreeimage-dev libcairo2-dev libfreetype6-dev libssl-dev libpulse-dev libusb-1.0-0-dev libgtk2.0-dev libopencv-dev libassimp-dev librtaudio-dev gdb libglfw3-dev liburiparser-dev libcurl4-openssl-dev libpugixml-dev libgconf-2-4 libgtk2.0-0 libpoco-dev libxcursor-dev libxi-dev libxinerama-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-libav gstreamer1.0-pulseaudio gstreamer1.0-x gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-plugins-base gstreamer1.0-plugins-good
packages: aptitude aptitude-common libboost-iostreams1.83.0 libcwidget4 libsigc++-2.0-0v5 libxapian30 fonts-wine{a} libasound2-plugins{a} libcapi20-3t64{a} libosmesa6{a} libpcsclite1{a} libspeexdsp1{a} libwine{a} libxkbregistry0{a} libz-mingw-w64{a} wine{a} wine64 wget2 make libjack-jackd2-0 libjack-jackd2-dev freeglut3-dev libasound2-dev libxmu-dev libxxf86vm-dev g++ libgl1-mesa-dev libglu1-mesa-dev libraw1394-dev libudev-dev libdrm-dev libglew-dev libopenal-dev libsndfile1-dev libfreeimage-dev libcairo2-dev libfreetype6-dev libpulse-dev libusb-1.0-0-dev libgtk2.0-dev libopencv-dev libassimp-dev librtaudio-dev gdb libglfw3-dev liburiparser-dev libpugixml-dev libgconf-2-4 libgtk2.0-0 libpoco-dev libxcursor-dev libxi-dev libxinerama-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-libav gstreamer1.0-pulseaudio gstreamer1.0-x gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-plugins-base gstreamer1.0-plugins-good
version: 1.0

- uses: actions/checkout@v4
Expand Down
Empty file modified scripts/ci/msys2/build.sh
100644 → 100755
Empty file.
Empty file modified scripts/ci/msys2/install.sh
100644 → 100755
Empty file.
Empty file modified scripts/ci/msys2/run_tests.sh
100644 → 100755
Empty file.
Empty file modified scripts/ci/vs/install.sh
100644 → 100755
Empty file.
Empty file modified scripts/ci/vs/run_tests.bat
100644 → 100755
Empty file.
128 changes: 98 additions & 30 deletions scripts/dev/download_libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ PLATFORM=""
ARCH=""
OVERWRITE=1
SILENT_ARGS=""
NO_SSL=""
BLEEDING_EDGE=0
DL_VERSION=2.2

printHelp(){
cat << EOF
Expand All @@ -25,6 +27,7 @@ cat << EOF
If not set deletes any existing libraries
-s, --silent Silent download progress
-h, --help Shows this message
-k, --no-ssl Allow no SSL validation
EOF
}

Expand All @@ -33,15 +36,21 @@ if [[ ! -d "$SCRIPT_DIR" ]]; then SCRIPT_DIR="$PWD"; fi
. "$SCRIPT_DIR/downloader.sh"

download(){
echo "Downloading $1"
echo ' -----'
#echo " Downloading $1"
# downloader ci.openframeworks.cc/libs/$1 $SILENT_ARGS

COMMAND=" "
REPO="nightly"
if [[ $BLEEDING_EDGE = 1 ]] ; then
echo downloader https://github.com/openframeworks/apothecary/releases/download/bleeding/$1 $SILENT_ARGS
downloader https://github.com/openframeworks/apothecary/releases/download/bleeding/$1 $SILENT_ARGS
else
echo downloader https://github.com/openframeworks/apothecary/releases/download/nightly/$1 $SILENT_ARGS
downloader https://github.com/openframeworks/apothecary/releases/download/nightly/$1 $SILENT_ARGS
REPO="bleeding"
fi

for PKG in $1; do
COMMAND+="https://github.com/openframeworks/apothecary/releases/download/$REPO/$PKG "
done
# echo $COMMAND;
downloader $COMMAND $SILENT_ARGS $NO_SSL
}

# trap any script errors and exit
Expand Down Expand Up @@ -89,7 +98,10 @@ while [[ $# -gt 0 ]]; do
BLEEDING_EDGE=1
;;
-s|--silent)
SILENT_ARGS=-nv
SILENT_ARGS=1
;;
-k|--no-ssl)
NO_SSL=1
;;
-h|--help)
printHelp
Expand All @@ -104,6 +116,10 @@ while [[ $# -gt 0 ]]; do
shift # past argument or value
done

if [[ "$TARGET" != "" ]] && [[ "$PLATFORM" == "" ]]; then
PLATFORM=$TARGET
fi

if [ "$PLATFORM" == "" ]; then
OS=$(uname)
if [ "$OS" == "Linux" ]; then
Expand Down Expand Up @@ -176,6 +192,8 @@ if [ "$PLATFORM" == "linux" ] && [ "$ARCH" == "64" ]; then
fi
fi

echo " openFrameworks download_libs.sh v$DL_VERSION"

if [ "$PLATFORM" == "msys2" ]; then
PKGS="openFrameworksLibs_${VER}_${PLATFORM}_${ARCH}.zip"
elif [ "$ARCH" == "" ] && [ "$PLATFORM" == "vs" ]; then
Expand Down Expand Up @@ -207,9 +225,9 @@ elif [[ "$PLATFORM" =~ ^(osx|ios|tvos|xros|catos|watchos)$ ]]; then
elif [ "$ARCH" == "" ] && [ "$PLATFORM" == "android" ]; then
if [[ $BLEEDING_EDGE = 1 ]] ; then
PKGS="openFrameworksLibs_${VER}_${PLATFORM}_armv7.tar.bz2 \
openFrameworksLibs_${VER}_${PLATFORM}_arm64.tar.bz2 \
openFrameworksLibs_${VER}_${PLATFORM}_x86_64.tar.bz2
openFrameworksLibs_${VER}_${PLATFORM}_x86.tar.bz2"
openFrameworksLibs_${VER}_${PLATFORM}_arm64.tar.bz2 \
openFrameworksLibs_${VER}_${PLATFORM}_x86_64.tar.bz2
openFrameworksLibs_${VER}_${PLATFORM}_x86.tar.bz2"
else
PKGS="openFrameworksLibs_${VER}_${PLATFORM}armv7.tar.bz2 \
openFrameworksLibs_${VER}_${PLATFORM}arm64.tar.bz2 \
Expand All @@ -223,33 +241,63 @@ else # Linux
fi
fi

for PKG in $PKGS; do
download $PKG
done

cd ../../
mkdir -p libs
cd libs

mkdir -p download
cd download

# IFS=' ' read -r -a PKGS_DATA <<< "$PKGS"
# if [ $OVERWRITE -eq 1 ]; then
# for ((i = 0; i < ${#PKGS_DATA[@]}; i++)); do
# FILE_CHECK="${PKGS_DATA[$i]}"
# # Check if the file exists
# if [ -e "${FILE_CHECK}" ]; then
# echo " Removing Prior Download:[${FILE_CHECK}]"
# # Remove the file or directory
# rm -rf "${FILE_CHECK}"
# fi
# done
# fi

download "${PKGS[@]}"

cd ../ # back to libs

if [ $OVERWRITE -eq 1 ]; then
echo "Removing old libraries"
libs=("boost" "cairo" "curl" "FreeImage" "freetype" "glew" "glfw" "json" "libpng" "openssl" "pixman" "poco" "rtAudio" "tess2" "uriparser" "utf8" "videoInput" "zlib" "opencv" "ippicv" "assimp" "libxml2" "svgtiny" "README.md")
for lib in $libs; do
if [ -e $lib ]; then
rm -rf $lib
echo " "
echo " Overwrite - Removing prior libraries for [$PLATFORM]"
libs=("boost" "cairo" "curl" "FreeImage" "brotli" "fmod" "freetype" "glew" "glfw" "json" "libpng" "openssl" "pixman" "poco" "rtAudio" "tess2" "uriparser" "utf8" "videoInput" "zlib" "opencv" "ippicv" "assimp" "libxml2" "svgtiny" "fmt")
for ((i=0;i<${#libs[@]};++i)); do
if [ -e "${libs[i]}/lib/$PLATFORM" ]; then
echo " Removing: [${libs[i]}/lib/$PLATFORM]"
rm -rf "${libs[i]}/lib/$PLATFORM"
fi
if [ "$PLATFORM" == "msys2" ] || [ "$PLATFORM" == "vs" ]; then
if [ -e "${libs[i]}/bin" ]; then
echo " Removing: [${libs[i]}/bin]"
rm -rf "${libs[i]}/bin"
fi
fi
# if [ -e "${libs[i]}/include" ]; then
# echo " Removing: [${libs[i]}/include]"
# rm -rf "${libs[i]}/include"
# fi
done
fi

echo " ------ "
for PKG in $PKGS; do
echo "Uncompressing libraries ${PLATFORM}${ARCH} from $PKG"
echo " Uncompressing libraries [${PLATFORM}] from [$PKG]"
if [ "$PLATFORM" == "msys2" ] || [ "$PLATFORM" == "vs" ]; then
unzip -qo ../scripts/dev/$PKG
rm ../scripts/dev/$PKG
unzip -qo download/$PKG
# rm -r download/$PKG
else
tar xjf ../scripts/dev/$PKG
rm ../scripts/dev/$PKG
tar xjf download/$PKG
# rm -r download/$PKG
fi
echo " Deployed libraries from [download/$PKG]to [/libs]"
done

if [ "$PLATFORM" == "osx" ]; then
Expand All @@ -266,13 +314,31 @@ else
addons=("ofxOpenCv" "ofxOpenCv" "ofxAssimpModelLoader" "ofxSvg" "ofxSvg" "ofxPoco")
fi

for ((i=0;i<${#addonslibs[@]};++i)); do
if [ -e ${addonslibs[i]} ]; then
echo "Copying ${addonslibs[i]} to ${addons[i]}"
if [ $OVERWRITE -eq 1 ] && [ -e ../addons/${addons[i]}/libs/${addonslibs[i]} ]; then
echo "Removing old opencv libraries"
rm -rf ../addons/${addons[i]}/libs/${addonslibs[i]}
echo " ------ "
if [ $OVERWRITE -eq 1 ]; then
for ((i=0;i<${#addonslibs[@]};++i)); do
if [ -e ${addonslibs[i]} ] ; then
echo " Overwrite - addon: [${addons[i]} - ${addonslibs[i]}]"
if [ -e ../addons/${addons[i]}/libs/${addonslibs[i]}/lib/$PLATFORM ]; then
echo " Remove binaries: [${addons[i]}/libs/${addonslibs[i]}/lib/$PLATFORM]"
rm -rf ../addons/${addons[i]}/libs/${addonslibs[i]}/lib/$PLATFORM
fi
if [ -e ../addons/${addons[i]}/libs/${addonslibs[i]}/bin ]; then
echo " Remove binaries: [${addons[i]}/libs/${addonslibs[i]}/bin]"
rm -rf ../addons/${addons[i]}/libs/${addonslibs[i]}/bin
fi
# if [ -e ../addons/${addons[i]}/libs/${addonslibs[i]}/include ]; then
# echo " Remove include: [${addons[i]}/libs/include]"
# rm -rf ../addons/${addons[i]}/libs/${addonslibs[i]}/include
# fi
fi
done
echo " ------ "
fi

for ((i=0;i<${#addonslibs[@]};++i)); do
if [ -e "${addonslibs[i]}" ]; then
echo " Deploying [${addonslibs[i]}] to [../addons/${addons[i]}/libs]"
mkdir -p ../addons/${addons[i]}/libs/${addonslibs[i]}
if ! command -v rsync &> /dev/null
then
Expand All @@ -284,3 +350,5 @@ for ((i=0;i<${#addonslibs[@]};++i)); do
fi
done

echo " ------ "
echo " openFrameworks download_libs and install complete!"
Loading