cmake: add PNG dep #268
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
push: {branches-ignore: [latest], tags: ['*']} | |
pull_request: | |
env: | |
PACKAGE_NAME: ${{ github.event.repository.name }} | |
PACKAGE_VERSION: ${{ github.sha }} | |
MYCI_NEXUS_USERNAME: cppfw | |
MYCI_NEXUS_PASSWORD: ${{ secrets.MYCI_NEXUS_PASSWORD }} | |
MYCI_GIT_USERNAME: igagis | |
MYCI_GIT_PASSWORD: ${{ secrets.MYCI_GIT_ACCESS_TOKEN }} | |
MYCI_CONAN_REMOTE: https://gagis.hopto.org/conan | |
MYCI_CONAN_USER: cppfw | |
MYCI_CONAN_PASSWORD: ${{ secrets.MYCI_CONAN_PASSWORD }} | |
jobs: | |
##### linux ##### | |
linux: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# - {os: debian, codename: buster, image_owner: , package_type: deb} | |
# - {os: debian, codename: buster, image_owner: i386/, package_type: deb, labels: [i386,docker]} | |
# - {os: debian, codename: buster, image_owner: arm32v7/, package_type: deb, labels: [ubuntu-24.04-arm]} | |
# - {os: debian, codename: bullseye, image_owner: , package_type: deb} | |
# - {os: debian, codename: bullseye, image_owner: , package_type: deb, labels: [i386,docker]} | |
# - {os: debian, codename: bullseye, image_owner: , package_type: deb, labels: [ubuntu-24.04-arm]} | |
# - {os: debian, codename: bullseye, image_owner: , package_type: deb, labels: [ubuntu-24.04-arm]} | |
- {os: debian, codename: bookworm, image_owner: , package_type: deb} | |
# - {os: debian, codename: bookworm, image_owner: , package_type: deb, labels: [i386,docker]} | |
- {os: debian, codename: bookworm, image_owner: arm32v7/, package_type: deb, labels: [ubuntu-24.04-arm]} | |
- {os: debian, codename: bookworm, image_owner: arm64v8/, package_type: deb, labels: [ubuntu-24.04-arm]} | |
# - {os: ubuntu, codename: focal, image_owner: , package_type: deb} | |
# - {os: ubuntu, codename: jammy, image_owner: , package_type: deb} | |
- {os: ubuntu, codename: noble, image_owner: , package_type: deb} | |
# - {os: raspbian, codename: buster, image_owner: igagis/, package_type: deb, labels: [arm,docker]} | |
# - {os: raspbian, codename: bullseye, image_owner: igagis/, package_type: deb, labels: [arm,docker]} | |
# - {os: raspbian, codename: bookworm, image_owner: igagis/, package_type: deb, labels: [ubuntu-24.04-arm]} | |
runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }} | |
container: ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }} | |
name: linux - ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }} | |
steps: | |
- name: add cppfw deb repo | |
uses: myci-actions/add-deb-repo@main | |
with: | |
repo: deb https://gagis.hopto.org/repo/cppfw/${{ matrix.os }} ${{ matrix.codename }} main | |
repo-name: cppfw | |
keys-asc: https://gagis.hopto.org/repo/cppfw/pubkey.gpg | |
install: myci git | |
- name: add llvm repo (for clang-format) | |
uses: myci-actions/add-deb-repo@main | |
with: | |
repo: deb https://apt.llvm.org/${{ matrix.codename }} llvm-toolchain-${{ matrix.codename }} main | |
repo-name: llvm | |
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key | |
- name: install ci tools | |
run: | | |
# configure timezone to avoid 'tzdata' package to require user interaction during installation (needed for ubuntu:focal) | |
TZ=Europe/Helsinki ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | |
apt install --assume-yes devscripts equivs | |
- name: git clone | |
uses: myci-actions/checkout@main | |
- name: set PACKAGE_VERSION | |
uses: myci-actions/export-env-var@main | |
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh debian/changelog)} | |
- name: prepare debian package | |
run: myci-deb-prepare.sh | |
- name: install deps | |
run: myci-deb-install-build-deps.sh | |
- name: build | |
run: dpkg-buildpackage --unsigned-source --unsigned-changes | |
- name: deploy deb packages | |
run: | | |
echo "${{ secrets.MYCI_REPO_SSH_KEY }}" > repo_key_rsa && chmod 600 repo_key_rsa | |
myci-deploy-apt-ssh.sh --key repo_key_rsa --server gagis.hopto.org --repo cppfw/${{ matrix.os }} --distro ${{ matrix.codename }} --component main ../lib${PACKAGE_NAME}*_${PACKAGE_VERSION}_*.*deb | |
if: matrix.package_type == 'deb' && startsWith(github.ref, 'refs/tags/') | |
##### ios ##### | |
ios: | |
runs-on: macos-latest | |
steps: | |
- name: workaround python2 and python3 issue when upgrading python | |
run : | | |
rm -rf /usr/local/bin/2to3* | |
rm -rf /usr/local/bin/idle3* | |
rm -rf /usr/local/bin/pydoc3* | |
rm -rf /usr/local/bin/python3 | |
rm -rf /usr/local/bin/python3-config | |
rm -rf /usr/local/bin/python3* | |
rm -rf /usr/local/bin/python3*-config | |
- name: add cppfw tap | |
run: | | |
brew tap cppfw/tap | |
brew update | |
- name: install ci tools | |
run: brew install myci | |
- name: git clone | |
uses: myci-actions/checkout@main | |
- name: set PACKAGE_VERSION | |
uses: myci-actions/export-env-var@main | |
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh debian/changelog)} | |
- name: add cocoapods repo | |
run: pod repo add --silent cppfw https://$MYCI_GIT_USERNAME@github.com/cppfw/cocoapods-repo.git | |
- name: install deps | |
run: pod install --project-directory=xcode | |
- name: add sources to xcode project | |
run: | | |
curl -L https://github.com/zackslash/Xcode-Proj-Adder/raw/master/bin/XcodeProjAdder -O | |
chmod +x XcodeProjAdder | |
cd xcode/$PACKAGE_NAME | |
../../XcodeProjAdder -XCP $PACKAGE_NAME.xcodeproj -SCSV `echo $(find ../../src -type f -name *.cpp) | sed -E -e 's/ /,/g'` | |
- name: build | |
run: | | |
xcodebuild CONFIGURATION_BUILD_DIR=../build_ios -sdk iphoneos -workspace xcode/$PACKAGE_NAME.xcworkspace -scheme $PACKAGE_NAME -configuration Release | |
xcodebuild CONFIGURATION_BUILD_DIR=../build_iossim -sdk iphonesimulator -workspace xcode/$PACKAGE_NAME.xcworkspace -scheme $PACKAGE_NAME -configuration Release | |
xcodebuild -create-xcframework -framework "xcode/build_ios/$PACKAGE_NAME.framework" -framework "xcode/build_iossim/$PACKAGE_NAME.framework" -output "xcode/$PACKAGE_NAME.xcframework" | |
- name: create package | |
run: myci-create-zip-package.sh --headers-dir src --file xcode/$PACKAGE_NAME.xcframework///lib/ios --file LICENSE $PACKAGE_NAME-$PACKAGE_VERSION.zip | |
- name: deploy | |
run: | | |
echo "${{ secrets.MYCI_REPO_SSH_KEY }}" > repo_key_rsa && chmod 600 repo_key_rsa | |
myci-deploy-cocoapods-ssh.sh --repo cppfw --version $PACKAGE_VERSION --server gagis.hopto.org --key repo_key_rsa --generic-repo cppfw/cocoapods --package $PACKAGE_NAME-$PACKAGE_VERSION.zip cocoapods/$PACKAGE_NAME.podspec.in | |
if: startsWith(github.ref, 'refs/tags/') | |
##### android ##### | |
android: | |
runs-on: ubuntu-latest | |
container: mingc/android-build-box:latest | |
steps: | |
- name: git clone | |
uses: myci-actions/checkout@main | |
- name: add cppfw deb repo | |
uses: myci-actions/add-deb-repo@main | |
with: | |
repo: deb https://gagis.hopto.org/repo/cppfw/$(lsb_release --id --short | tr '[:upper:]' '[:lower:]') $(lsb_release --codename --short) main | |
repo-name: cppfw | |
keys-asc: https://gagis.hopto.org/repo/cppfw/pubkey.gpg | |
install: myci | |
- name: set PACKAGE_VERSION | |
uses: myci-actions/export-env-var@main | |
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh debian/changelog)} | |
- name: build | |
run: | | |
cd android | |
./gradlew copy_aar --warning-mode all | |
myci-apply-version.sh -v $PACKAGE_VERSION *.pom.in | |
myci-apply-version.sh -v $PACKAGE_VERSION *.aar.in --filename-only | |
- name: deploy | |
run: myci-deploy-maven-nexus.sh --base-url https://gagis.hopto.org/nexus --repo android android/$PACKAGE_NAME-$PACKAGE_VERSION.aar | |
if: startsWith(github.ref, 'refs/tags/') | |
##### vcpkg ##### | |
vcpkg: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- {os: debian, codename: bookworm, image_owner: } | |
# - {os: debian, codename: bookworm, image_owner: i386/, labels: [i386,docker]} | |
# - {os: debian, codename: bookworm, image_owner: arm32v7/, labels: [ubuntu-24.04-arm]} | |
# - {os: debian, codename: bookworm, image_owner: arm64v8/, labels: [ubuntu-24.04-arm]} | |
runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }} | |
container: ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }} | |
name: vcpkg - linux | ${{ matrix.image_owner }} | |
steps: | |
- name: add cppfw deb repo | |
uses: myci-actions/add-deb-repo@main | |
with: | |
repo: deb https://gagis.hopto.org/repo/cppfw/${{ matrix.os }} ${{ matrix.codename }} main | |
repo-name: cppfw | |
keys-asc: https://gagis.hopto.org/repo/cppfw/pubkey.gpg | |
install: myci cmake git curl zip unzip tar nodejs pkg-config libgl1-mesa-dev libglu1-mesa-dev libgles2-mesa-dev | |
- name: git clone | |
uses: myci-actions/checkout@main | |
- name: install vcpkg | |
run: | | |
git clone https://github.com/microsoft/vcpkg.git vcpkg-installation | |
(cd vcpkg-installation; ./bootstrap-vcpkg.sh) | |
- name: set VCPKG_ROOT | |
uses: myci-actions/export-env-var@main | |
with: {name: VCPKG_ROOT, value: "$(pwd)/vcpkg-installation"} | |
- name: add VCPKG_ROOT to PATH | |
uses: myci-actions/export-env-var@main | |
with: {name: PATH, value: "$PATH:$VCPKG_ROOT"} | |
- name: prepare vcpkg port | |
run: | | |
myci-vcpkg-prepare.sh --vcpkg-dir build/vcpkg --git-ref ${{ github.sha }} | |
- name: test vcpkg port | |
run: | | |
cd build/vcpkg/test | |
cmake . | |
make | |
./test | |
- name: upload vcpkg logs to artifacts | |
if: always() # even if previous steps fail, this one needs to be run | |
uses: actions/upload-artifact@v4 | |
with: | |
name: vcpkg_logs | |
path: | | |
vcpkg-installation/buildtrees/${{ env.PACKAGE_NAME }}/ | |
build/vcpkg/**/*.log | |
- name: deploy vcpkg port | |
run: | | |
myci-deploy-vcpkg.sh --repo cppfw/vcpkg-repo --port-dir build/vcpkg/overlay/${PACKAGE_NAME} | |
if: startsWith(github.ref, 'refs/tags/') | |
##### conan - linux ##### | |
# conan-linux: | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# include: | |
# - {os: debian, codename: bookworm, image_owner: } | |
# # - {os: debian, codename: bookworm, image_owner: i386/, labels: [i386,docker]} | |
# # - {os: debian, codename: bookworm, image_owner: arm32v7/, labels: [ubuntu-24.04-arm]} | |
# # - {os: debian, codename: bookworm, image_owner: arm64v8/, labels: [ubuntu-24.04-arm]} | |
# runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }} | |
# container: ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }} | |
# name: conan - linux | ${{ matrix.labels[0] }} | |
# steps: | |
# - name: add llvm repo (for clang-format) | |
# uses: myci-actions/add-deb-repo@main | |
# with: | |
# repo: deb http://apt.llvm.org/${{ matrix.codename }} llvm-toolchain-${{ matrix.codename }} main | |
# repo-name: llvm | |
# keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key | |
# install: clang-format clang-tidy | |
# - name: add cppfw deb repo | |
# uses: myci-actions/add-deb-repo@main | |
# with: | |
# repo: deb https://gagis.hopto.org/repo/cppfw/${{ matrix.os }} ${{ matrix.codename }} main | |
# repo-name: cppfw | |
# keys-asc: https://gagis.hopto.org/repo/cppfw/pubkey.gpg | |
# install: devscripts equivs myci pipx cmake git | |
# - name: add ~/.local/bin to PATH | |
# uses: myci-actions/export-env-var@main | |
# with: {name: PATH, value: "$PATH:$HOME/.local/bin"} | |
# - name: install conan | |
# run: pipx install conan | |
# - name: create default conan profile | |
# run: | | |
# conan profile detect --name default | |
# sed -i -E "s/compiler.cppstd=.*$/compiler.cppstd=17/g" ~/.conan2/profiles/default | |
# - name: git clone | |
# uses: myci-actions/checkout@main | |
# - name: set PACKAGE_VERSION | |
# uses: myci-actions/export-env-var@main | |
# with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh debian/changelog)} | |
# if: startsWith(github.ref, 'refs/tags/') | |
# - name: build | |
# run: | | |
# conan remote add cppfw $MYCI_CONAN_REMOTE | |
# conan create conan --build=missing --user $MYCI_CONAN_USER --channel main --version $PACKAGE_VERSION | |
# - name: deploy conan package | |
# run: | | |
# conan remote login --password $MYCI_CONAN_PASSWORD cppfw $MYCI_CONAN_USER | |
# conan upload --check --remote cppfw $PACKAGE_NAME/$PACKAGE_VERSION@$MYCI_CONAN_USER/main | |
# if: startsWith(github.ref, 'refs/tags/') | |
##### conan - macosx ##### | |
# conan-macosx: | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# os: | |
# # - macos-10.15 | |
# # - macos-11 | |
# # - macos-12 | |
# - macos-latest | |
# name: conan - ${{ matrix.os }} | |
# runs-on: ${{ matrix.os }} | |
# steps: | |
# - name: workaround python2 and python3 issue when upgrading python | |
# run : | | |
# rm -rf /usr/local/bin/2to3* | |
# rm -rf /usr/local/bin/idle3* | |
# rm -rf /usr/local/bin/pydoc3* | |
# rm -rf /usr/local/bin/python3 | |
# rm -rf /usr/local/bin/python3-config | |
# rm -rf /usr/local/bin/python3* | |
# rm -rf /usr/local/bin/python3*-config | |
# - name: install clang-tidy and clang-format | |
# run: | | |
# brew install llvm | |
# ln -s "$(brew --prefix llvm)/bin/clang-format" "/usr/local/bin/clang-format" | |
# ln -s "$(brew --prefix llvm)/bin/clang-tidy" "/usr/local/bin/clang-tidy" | |
# ln -s "$(brew --prefix llvm)/bin/clang-apply-replacements" "/usr/local/bin/clang-apply-replacements" | |
# - name: git clone | |
# uses: myci-actions/checkout@main | |
# - name: add cppfw tap | |
# run: | | |
# brew tap cppfw/tap | |
# brew update | |
# - name: install ci tools | |
# run: brew install myci conan | |
# - name: create default conan profile | |
# run: | | |
# conan profile detect --name default | |
# sed -i -E "s/compiler.cppstd=.*$/compiler.cppstd=17/g" ~/.conan2/profiles/default | |
# - name: set PACKAGE_VERSION | |
# uses: myci-actions/export-env-var@main | |
# with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh debian/changelog)} | |
# if: startsWith(github.ref, 'refs/tags/') | |
# - name: build | |
# run: | | |
# conan remote add cppfw $MYCI_CONAN_REMOTE | |
# conan create conan --build=missing --user $MYCI_CONAN_USER --channel main --version $PACKAGE_VERSION | |
# - name: deploy conan package | |
# run: | | |
# conan remote login --password $MYCI_CONAN_PASSWORD cppfw $MYCI_CONAN_USER | |
# conan upload --check --remote cppfw $PACKAGE_NAME/$PACKAGE_VERSION@$MYCI_CONAN_USER/main | |
# if: startsWith(github.ref, 'refs/tags/') | |
##### conan - emscripten ##### | |
conan-emscripten: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# - {os: ubuntu, codename: noble, image_owner: } | |
- {os: debian, codename: bookworm, image_owner: } | |
# - {os: debian, codename: bookworm, image_owner: i386/, labels: [i386,docker]} | |
# - {os: debian, codename: bookworm, image_owner: , labels: [ubuntu-24.04-arm]} | |
# - {os: debian, codename: bookworm, image_owner: , labels: [ubuntu-24.04-arm]} | |
runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }} | |
container: ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }} | |
name: conan - emscripten | |
steps: | |
- name: add cppfw deb repo | |
uses: myci-actions/add-deb-repo@main | |
with: | |
repo: deb https://gagis.hopto.org/repo/cppfw/${{ matrix.os }} ${{ matrix.codename }} main | |
repo-name: cppfw | |
keys-asc: https://gagis.hopto.org/repo/cppfw/pubkey.gpg | |
install: devscripts equivs myci pipx cmake git nodejs | |
- name: add ~/.local/bin to PATH | |
uses: myci-actions/export-env-var@main | |
with: {name: PATH, value: "$PATH:$HOME/.local/bin"} | |
- name: install conan | |
run: pipx install conan | |
- name: create default conan profile | |
run: | | |
conan profile detect --name default | |
sed -i -E "s/compiler.cppstd=.*$/compiler.cppstd=17/g" ~/.conan2/profiles/default | |
- name: git clone | |
uses: myci-actions/checkout@main | |
with: | |
submodules: false | |
- name: set PACKAGE_VERSION | |
uses: myci-actions/export-env-var@main | |
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh debian/changelog)} | |
if: startsWith(github.ref, 'refs/tags/') | |
- name: build | |
run: | | |
conan remote add cppfw $MYCI_CONAN_REMOTE | |
# NOTE: specifying empty test folder to skip the test stage | |
conan create conan --profile:build default --profile:host emscripten/conan.profile --build=missing --user $MYCI_CONAN_USER --channel main --version $PACKAGE_VERSION --test-folder "" | |
- name: deploy conan package | |
run: | | |
conan remote login --password $MYCI_CONAN_PASSWORD cppfw $MYCI_CONAN_USER | |
conan upload --check --remote cppfw $PACKAGE_NAME/$PACKAGE_VERSION@$MYCI_CONAN_USER/main | |
if: startsWith(github.ref, 'refs/tags/') |