From 19824198780aae3e73a2cd93b1e2f744a31e2293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Sat, 6 Apr 2024 12:48:40 -0400 Subject: [PATCH] [ci] Continue refactors --- .../actions/latest-rpi-toolchain/action.yml | 2 +- .../latest-ubuntu-toolchain/action.yml | 4 +- .github/actions/mac-codesign/action.yml | 43 +++---------------- .github/workflows/benchmarks.yml | 5 +-- .github/workflows/coverage.yml | 5 +-- .github/workflows/libossia.yml | 10 +---- .github/workflows/ossia-cpp.yml | 20 +++------ .github/workflows/ossia-pd.yml | 6 +-- .github/workflows/ossia-purrdata.yml | 17 ++++---- .github/workflows/ossia-python.yml | 9 +--- .github/workflows/ossia-qml.yml | 10 +---- .github/workflows/ossia-unity.yml | 12 ++---- ci/codesign_functions.sh | 17 ++++---- 13 files changed, 42 insertions(+), 118 deletions(-) diff --git a/.github/actions/latest-rpi-toolchain/action.yml b/.github/actions/latest-rpi-toolchain/action.yml index dfd50039922..b7ec7759ef0 100644 --- a/.github/actions/latest-rpi-toolchain/action.yml +++ b/.github/actions/latest-rpi-toolchain/action.yml @@ -8,7 +8,7 @@ runs: run: | sudo apt-get update -yqq sudo apt-get upgrade -yqq - sudo apt-get install -yqq build-essential g++ ninja-build libavahi-client-dev wget + sudo apt-get install -yqq build-essential ninja-build libavahi-client-dev wget wget -nv https://github.com/tttapa/docker-arm-cross-toolchain/releases/download/0.1.2/x-tools-aarch64-rpi3-linux-gnu.tar.xz tar xaf x-tools-aarch64-rpi3-linux-gnu.tar.xz diff --git a/.github/actions/latest-ubuntu-toolchain/action.yml b/.github/actions/latest-ubuntu-toolchain/action.yml index 792c6ac0b0e..e31ae7db060 100644 --- a/.github/actions/latest-ubuntu-toolchain/action.yml +++ b/.github/actions/latest-ubuntu-toolchain/action.yml @@ -13,14 +13,14 @@ runs: sudo apt-get install -yqq kitware-archive-keyring sudo rm /etc/apt/trusted.gpg.d/kitware.gpg - echo 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main' | sudo tee /etc/apt/sources.list.d/llvm.list + echo 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main' | sudo tee /etc/apt/sources.list.d/llvm.list sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 1397BC53640DB551 15CF4D18AF4F7421 42D5A192B819C5DA sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test sudo apt-get update -qq sudo apt purge --auto-remove cmake sudo apt-get install -yqq \ build-essential g++ binutils ninja-build cmake \ - clang-15 lld-15 \ + clang-18 lld-18 \ qt6-base-dev qt6-base-dev-tools qt6-base-private-dev \ qt6-declarative-dev qt6-declarative-dev-tools qt6-declarative-private-dev \ libqt6websockets6-dev libqt6websockets6-dev \ diff --git a/.github/actions/mac-codesign/action.yml b/.github/actions/mac-codesign/action.yml index 5f3e19bf57a..fef134e4ceb 100644 --- a/.github/actions/mac-codesign/action.yml +++ b/.github/actions/mac-codesign/action.yml @@ -6,6 +6,10 @@ inputs: description: 'Path containing files to sign' required: true default: '' + output-name: + description: 'Output filename' + required: true + default: 'output.zip' MAC_CERT_B64: description: 'Certificate encoded as base64' required: true @@ -23,45 +27,10 @@ runs: steps: - name: Code Signing shell: bash - env: MAC_CERT_B64: ${{ inputs.MAC_CERT_B64 }} MAC_CERT_PASSWORD: ${{ inputs.MAC_CERT_PASSWORD }} MAC_ALTOOL_PASSWORD: ${{ inputs.MAC_ALTOOL_PASSWORD }} run: | - # Setup codesigning - # Thanks https://www.update.rocks/blog/osx-signing-with-travis/ - ( - set +x - KEY_CHAIN=build.keychain - echo "$MAC_CERT_B64" | base64 --decode > ossia-cert.p12 - - security create-keychain -p azure $KEY_CHAIN - security default-keychain -s $KEY_CHAIN - security unlock-keychain -p azure $KEY_CHAIN - security import ossia-cert.p12 -k $KEY_CHAIN -P "$MAC_CERT_PASSWORD" -T /usr/bin/codesign; - security set-key-partition-list -S apple-tool:,apple: -s -k azure $KEY_CHAIN - - rm -rf *.p12 - ) - - security unlock-keychain -p azure build.keychain - - ( - cd install - find ${{ inputs.path-to-sign }} \ - \( -name "*.dylib" -o -name "*.a" -o -name "*.so" -o -name "*.mxo" -o -name "ossia.d_*" \) \ - -exec echo Signing {} + \ - -exec codesign --force --timestamp --sign "ossia.io" {} + - - ditto -c -k --sequesterRsrc --keepParent ${{ inputs.path-to-sign }} codesign.zip - - xcrun notarytool submit "codesign.zip" \ - --team-id "GRW9MHZ724" \ - --apple-id "jeanmichael.celerier@gmail.com" \ - --password "$MAC_ALTOOL_PASSWORD" \ - --progress \ - --wait - - rm codesign.zip - ) + source "${GITHUB_WORKSPACE}/ci/codesign_functions.sh" + release_macos_folder "${{ inputs.path-to-sign }}" "$PWD/${{ inputs.output-name }}" diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index c8591c1670f..f9d18b5a563 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -12,16 +12,13 @@ jobs: - name: Install Dependencies run: | sudo apt update -qq - sudo apt install -qq -y build-essential gcc-11 g++-11 ninja-build wget + sudo apt install -qq -y build-essential ninja-build wget wget https://github.com/jcelerier/cninja/releases/download/v3.7.6/cninja-v3.7.6-Linux.tar.gz tar xaf cninja-*-Linux.tar.gz sudo mv cninja "/usr/bin/" rm *.tar.gz - name: Build - env: - CC: gcc-11 - CXX: g++-11 run: | echo $(variables.gitTag) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index b861d83b381..94224f92555 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -12,14 +12,11 @@ jobs: run: | sudo gem install coveralls-lcov - sudo apt-get install -yqq python3 python3-pip lcov gcc-11 g++-11 gcovr + sudo apt-get install -yqq python3 python3-pip lcov build-essential gcovr sudo pip3 install --upgrade wheel setuptools sudo pip3 install git+https://github.com/rpgillespie6/fastcov.git - name: Build - env: - CC: gcc-11 - CXX: g++-11 run: | QT_ENV_SCRIPT=$(find /opt -name 'qt*-env.sh') set +e diff --git a/.github/workflows/libossia.yml b/.github/workflows/libossia.yml index ff89f4a5acc..18d5fa2a67a 100644 --- a/.github/workflows/libossia.yml +++ b/.github/workflows/libossia.yml @@ -26,6 +26,7 @@ jobs: -DOSSIA_TESTING=1 \ -DOSSIA_CI=1 \ -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" + cmake --build build cmake --build build --target test cmake --build build --target install @@ -52,7 +53,6 @@ jobs: fail-fast: false steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/latest-msvc-toolchain - name : Build @@ -81,17 +81,11 @@ jobs: fail-fast: false steps: - uses: actions/checkout@v4 - - name: Install Dependencies - run: | - sudo apt-get update -yqq - sudo apt-get upgrade -yqq - sudo apt-get install -yqq build-essential g++-11 gcc-11 ninja-build libavahi-client-dev + - uses: ./.github/actions/latest-ubuntu-toolchain - name: Build env: STATIC: ${{ matrix.static }} BUILD_TYPE: ${{ matrix.build_type }} - CC: gcc-11 - CXX: g++-11 run: | cmake -B build -S ${GITHUB_WORKSPACE} -GNinja \ diff --git a/.github/workflows/ossia-cpp.yml b/.github/workflows/ossia-cpp.yml index 7200e5390dc..8aa2ad6bf95 100644 --- a/.github/workflows/ossia-cpp.yml +++ b/.github/workflows/ossia-cpp.yml @@ -9,14 +9,8 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Build Dependencies - run: | - sudo apt-get update -qq - sudo apt-get install -yqq build-essential gcc-11 g++-11 ninja-build libavahi-client-dev + - uses: ./.github/actions/latest-ubuntu-toolchain - name: Build - env: - CC: gcc-11 - CXX: g++-11 run: | cmake -B build -S ${GITHUB_WORKSPACE} -GNinja \ -DOSSIA_CPP_ONLY=1 \ @@ -35,6 +29,7 @@ jobs: cpp-mac: name: CPP (macOS) runs-on: macos-14 + environment: 'Apple Certificate' steps: - uses: actions/checkout@v4 - uses: ./.github/actions/latest-mac-toolchain @@ -43,22 +38,19 @@ jobs: cmake -B build -S ${GITHUB_WORKSPACE} -GNinja -DOSSIA_CPP_ONLY=1 -DOSSIA_CI=1 -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release cmake --build build cmake --build build --target install - - name: Code Signing - shell: bash - env: + + - uses: ./.github/actions/mac-codesign + with: + path-to-sign: install MAC_CERT_B64: ${{ secrets.MAC_CERT_B64 }} MAC_CERT_PASSWORD: ${{ secrets.MAC_CERT_PASSWORD }} MAC_ALTOOL_PASSWORD: ${{ secrets.MAC_ALTOOL_PASSWORD }} - run: | - source ${GITHUB_WORKSPACE}/ci/codesign_functions.sh - release_macos_folder "${GITHUB_WORKSPACE}/install" "$PWD/ossia-cpp-osx.zip" "io.ossia.ossia-cpp" - name: Archive Package uses: actions/upload-artifact@v2 with: name: ossia-cpp path: install - environment: 'Apple Certificate' cpp-windows: name: CPP (Windows) diff --git a/.github/workflows/ossia-pd.yml b/.github/workflows/ossia-pd.yml index c14823a4dc3..1ab2b7d2f28 100644 --- a/.github/workflows/ossia-pd.yml +++ b/.github/workflows/ossia-pd.yml @@ -57,11 +57,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install Dependencies - run: | - sudo apt-get update -yqq - sudo apt-get upgrade -yqq - sudo apt-get install -yqq build-essential ninja-build libavahi-client-dev + - uses: ./.github/actions/latest-ubuntu-toolchain - name: Build run: | cmake -B build -S ${GITHUB_WORKSPACE} -GNinja -DOSSIA_CI=1 -DCMAKE_BUILD_TYPE=Release -DOSSIA_PD_ONLY=1 -DCMAKE_INSTALL_PREFIX=install diff --git a/.github/workflows/ossia-purrdata.yml b/.github/workflows/ossia-purrdata.yml index 694e803cbe2..36dc6807625 100644 --- a/.github/workflows/ossia-purrdata.yml +++ b/.github/workflows/ossia-purrdata.yml @@ -58,17 +58,16 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install Dependencies - run: | - sudo apt-get update -yqq - sudo apt-get upgrade -yqq - sudo apt-get install -yqq build-essential gcc-11 g++-11 ninja-build libavahi-client-dev + - uses: ./.github/actions/latest-ubuntu-toolchain - name: Build - env: - CC: gcc-11 - CXX: g++-11 run: | - cmake -B build -S ${GITHUB_WORKSPACE} -GNinja -DOSSIA_PURR_DATA=1 -DOSSIA_CI=1 -DCMAKE_BUILD_TYPE=Release -DOSSIA_PD_ONLY=1 -DCMAKE_INSTALL_PREFIX=install + cmake -B build -S ${GITHUB_WORKSPACE} \ + -GNinja \ + -DOSSIA_PURR_DATA=1 \ + -DOSSIA_CI=1 \ + -DCMAKE_BUILD_TYPE=Release \ + -DOSSIA_PD_ONLY=1 \ + -DCMAKE_INSTALL_PREFIX=install cmake --build build cmake --build build --target install - name: Archive Package diff --git a/.github/workflows/ossia-python.yml b/.github/workflows/ossia-python.yml index beb3f293125..0689034c4b3 100644 --- a/.github/workflows/ossia-python.yml +++ b/.github/workflows/ossia-python.yml @@ -34,14 +34,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install Dependencies - run: | - sudo apt-get update -yqq - sudo apt-get upgrade -yqq - sudo apt-get install -yqq build-essential gcc-11 g++-11 ninja-build libavahi-client-dev - env: - CC: gcc-11 - CXX: g++-11 + - uses: ./.github/actions/latest-ubuntu-toolchain - name: Build ossia-python run: | cmake -B build -S ${GITHUB_WORKSPACE} -G Ninja -DOSSIA_PYTHON_ONLY=1 -DOSSIA_CI=1 diff --git a/.github/workflows/ossia-qml.yml b/.github/workflows/ossia-qml.yml index 48b79ac7060..3c54c379869 100644 --- a/.github/workflows/ossia-qml.yml +++ b/.github/workflows/ossia-qml.yml @@ -9,14 +9,8 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Build Dependencies - run: | - sudo apt-get update -qq - sudo apt-get install -yqq build-essential gcc g++ ninja-build libavahi-client-dev + - uses: ./.github/actions/latest-ubuntu-toolchain - name: Build - env: - CC: gcc - CXX: g++ run: | cmake -B build -S ${GITHUB_WORKSPACE} -GNinja \ -DOSSIA_CI=1 \ @@ -34,6 +28,7 @@ jobs: qml-mac: name: QML (macOS) runs-on: macos-14 + environment: 'Apple Certificate' steps: - uses: actions/checkout@v4 - uses: ./.github/actions/latest-mac-toolchain @@ -65,7 +60,6 @@ jobs: with: name: ossia-qml path: install - environment: 'Apple Certificate' qml-windows: name: QML (Windows) diff --git a/.github/workflows/ossia-unity.yml b/.github/workflows/ossia-unity.yml index 4c2d0eeb287..7e466b41724 100644 --- a/.github/workflows/ossia-unity.yml +++ b/.github/workflows/ossia-unity.yml @@ -9,14 +9,8 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Build Dependencies - run: | - sudo apt-get update -qq - sudo apt-get install -yqq build-essential gcc-11 g++-11 ninja-build libavahi-client-dev + - uses: ./.github/actions/latest-ubuntu-toolchain - name: Build - env: - CC: gcc-11 - CXX: g++-11 run: | cmake -B build -S ${GITHUB_WORKSPACE} -GNinja -DOSSIA_UNITY3D_ONLY=1 -DOSSIA_CI=1 -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release cmake --build build @@ -30,6 +24,7 @@ jobs: Unity3DMac: name: Unity3D (macOS) runs-on: macos-14 + environment: 'Apple Certificate' steps: - uses: actions/checkout@v4 - uses: ./.github/actions/latest-mac-toolchain @@ -86,11 +81,11 @@ jobs: with: name: ossia-unity path: install - environment: 'Apple Certificate' Unity3DIOs: name: Unity3D (iOS) runs-on: macos-14 + environment: 'Apple Certificate' steps: - uses: actions/checkout@v4 - uses: ./.github/actions/latest-mac-toolchain @@ -157,7 +152,6 @@ jobs: with: name: ossia-unity-ios path: install - environment: 'Apple Certificate' Unity3DWin32: name: Unity3D (Win32) diff --git a/ci/codesign_functions.sh b/ci/codesign_functions.sh index 6aeaba8056e..63710170894 100644 --- a/ci/codesign_functions.sh +++ b/ci/codesign_functions.sh @@ -29,24 +29,23 @@ codesign_osx() { notarize_osx() { set +x local zipfile=${1} - local bundle_id=${2} - xcrun altool --notarize-app \ - -t osx \ - -f "$zipfile" \ - --primary-bundle-id "$bundle_id" \ - -u jeanmichael.celerier@gmail.com \ - -p "@env:MAC_ALTOOL_PASSWORD" + xcrun notarytool \ + submit "$zipfile" \ + --team-id "GRW9MHZ724" \ + --apple-id "jeanmichael.celerier@gmail.com" \ + --password "$MAC_ALTOOL_PASSWORD" \ + --progress \ + --wait } release_macos_folder() { local folder="${1}" local zipfile="${2}" - local bundle_id="${3}" codesign_osx "$folder" ( cd "$folder"/.. || return ditto -c -k --sequesterRsrc --keepParent $(basename "$folder") "${ARTIFACTS_DIR}/$zipfile" - notarize_osx "${ARTIFACTS_DIR}/$zipfile" "$bundle_id" + notarize_osx "${ARTIFACTS_DIR}/$zipfile" ) } \ No newline at end of file