From d7ce445a869188467f9eaed7ac14e1620bf76229 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Mon, 9 Jun 2025 15:45:19 -0400 Subject: [PATCH 01/10] Experimenting to see if conda constructor will work via Github Actions --- .github/workflows/constructor.yml | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/constructor.yml diff --git a/.github/workflows/constructor.yml b/.github/workflows/constructor.yml new file mode 100644 index 00000000..68ed8de5 --- /dev/null +++ b/.github/workflows/constructor.yml @@ -0,0 +1,39 @@ +# Set this workflow up to run on pushes to the main branch +name: Constructor +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + constructor: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Conda + uses: conda-incubator/setup-miniconda@v3 + with: + auto-update-conda: true + auto-activate-base: false + + - name: Create Conda environment + run: | + conda create -n constructor python=3.10 -y + conda activate constructor + conda install -c conda-forge constructor conda-libmamba-solver + + - name: Run Constructor + run: | + mkdir out && cd out && constructor ../conda + + - name: Upload Constructor output + uses: actions/upload-artifact@v4 + with: + name: installer_linux + path: out/* From 54e0b83cae7e361fef008ff7e72094ead560637e Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Mon, 9 Jun 2025 15:52:28 -0400 Subject: [PATCH 02/10] Fixed branch --- .github/workflows/constructor.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/constructor.yml b/.github/workflows/constructor.yml index 68ed8de5..9beebd51 100644 --- a/.github/workflows/constructor.yml +++ b/.github/workflows/constructor.yml @@ -3,12 +3,11 @@ name: Constructor on: push: branches: - - main + - master pull_request: branches: - - main - workflow_dispatch: - + - master + jobs: constructor: runs-on: ubuntu-latest From 1a2b1e323e70dc8b1e7e15c995c85cdfc387dbb5 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Mon, 9 Jun 2025 15:57:43 -0400 Subject: [PATCH 03/10] Trying to fix conda --- .github/workflows/constructor.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/constructor.yml b/.github/workflows/constructor.yml index 9beebd51..4ec229b4 100644 --- a/.github/workflows/constructor.yml +++ b/.github/workflows/constructor.yml @@ -18,17 +18,13 @@ jobs: - name: Set up Conda uses: conda-incubator/setup-miniconda@v3 with: - auto-update-conda: true - auto-activate-base: false + miniconda-version: "latest" + activate-environment: constructor - name: Create Conda environment + shell: bash -el {0} run: | - conda create -n constructor python=3.10 -y - conda activate constructor conda install -c conda-forge constructor conda-libmamba-solver - - - name: Run Constructor - run: | mkdir out && cd out && constructor ../conda - name: Upload Constructor output From 80b417796576c9f16a7b9db8eda677aedaf442dc Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Mon, 9 Jun 2025 16:19:55 -0400 Subject: [PATCH 04/10] Added Windows and MacOS constructor builds --- .github/workflows/constructor.yml | 52 +++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/.github/workflows/constructor.yml b/.github/workflows/constructor.yml index 4ec229b4..cf047a77 100644 --- a/.github/workflows/constructor.yml +++ b/.github/workflows/constructor.yml @@ -9,7 +9,7 @@ on: - master jobs: - constructor: + constructor-linux: runs-on: ubuntu-latest steps: - name: Checkout repository @@ -30,5 +30,51 @@ jobs: - name: Upload Constructor output uses: actions/upload-artifact@v4 with: - name: installer_linux - path: out/* + name: CQ-editor-master-Linux-x86_64 + path: out/*.* + constructor-windows: + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Conda + uses: conda-incubator/setup-miniconda@v3 + with: + miniconda-version: "latest" + activate-environment: constructor + + - name: Create Conda environment + shell: bash -el {0} + run: | + conda install -c conda-forge constructor conda-libmamba-solver + mkdir out && cd out && constructor ../conda + + - name: Upload Constructor output + uses: actions/upload-artifact@v4 + with: + name: CQ-editor-master-Windows-x86_64 + path: out/*.* + constructor-macos: + runs-on: macos-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Conda + uses: conda-incubator/setup-miniconda@v3 + with: + miniconda-version: "latest" + activate-environment: constructor + + - name: Create Conda environment + shell: bash -el {0} + run: | + conda install -c conda-forge constructor conda-libmamba-solver + mkdir out && cd out && constructor ../conda + + - name: Upload Constructor output + uses: actions/upload-artifact@v4 + with: + name: CQ-editor-master-MacOSX-x86_64 + path: out/*.* From d973b07bc2c6d5b8fa7c384d1b5c89bb0c2838f0 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Mon, 9 Jun 2025 16:58:01 -0400 Subject: [PATCH 05/10] Trying to separate out MacOS AMD and ARM builds --- .github/workflows/constructor.yml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/constructor.yml b/.github/workflows/constructor.yml index cf047a77..fd729bf4 100644 --- a/.github/workflows/constructor.yml +++ b/.github/workflows/constructor.yml @@ -55,8 +55,31 @@ jobs: with: name: CQ-editor-master-Windows-x86_64 path: out/*.* - constructor-macos: - runs-on: macos-latest + constructor-macos-arm64: + runs-on: macos-14 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Conda + uses: conda-incubator/setup-miniconda@v3 + with: + miniconda-version: "latest" + activate-environment: constructor + + - name: Create Conda environment + shell: bash -el {0} + run: | + conda install -c conda-forge constructor conda-libmamba-solver + mkdir out && cd out && constructor ../conda + + - name: Upload Constructor output + uses: actions/upload-artifact@v4 + with: + name: CQ-editor-master-MacOSX-ARM64 + path: out/*.* + constructor-macos-x86_64: + runs-on: macos-13 steps: - name: Checkout repository uses: actions/checkout@v4 From ef2e4f8499de389d27d383217d0b65dc48bce2d0 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Mon, 9 Jun 2025 17:18:02 -0400 Subject: [PATCH 06/10] Disabled constructor builds on PRs now that the CI builds are working --- .github/workflows/constructor.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/constructor.yml b/.github/workflows/constructor.yml index fd729bf4..07120f6e 100644 --- a/.github/workflows/constructor.yml +++ b/.github/workflows/constructor.yml @@ -4,9 +4,6 @@ on: push: branches: - master - pull_request: - branches: - - master jobs: constructor-linux: From 0670944442353dab525e15b8db6c6b4b0b8e78e9 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Mon, 9 Jun 2025 21:29:24 -0400 Subject: [PATCH 07/10] Disable Azure Pipelines --- azure-pipelines.yml | 160 ++++++++++++++++++++++---------------------- 1 file changed, 80 insertions(+), 80 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 77e02d43..c73ffacd 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,88 +1,88 @@ -trigger: - branches: - include: - - master - - refs/tags/* - exclude: - - refs/tags/nightly +# trigger: +# branches: +# include: +# - master +# - refs/tags/* +# exclude: +# - refs/tags/nightly -pr: -- master +# pr: +# - master -resources: - repositories: - - repository: templates - type: github - name: CadQuery/conda-packages - endpoint: CadQuery +# resources: +# repositories: +# - repository: templates +# type: github +# name: CadQuery/conda-packages +# endpoint: CadQuery -parameters: - - name: minor - type: object - default: - - 11 +# parameters: +# - name: minor +# type: object +# default: +# - 11 -stages: -- stage: build_conda_package - jobs: - - ${{ each minor in parameters.minor }}: - - template: conda-build.yml@templates - parameters: - name: Linux - vmImage: 'ubuntu-latest' - py_maj: 3 - py_min: ${{minor}} - conda_bld: 3.21.6 +# stages: +# - stage: build_conda_package +# jobs: +# - ${{ each minor in parameters.minor }}: +# - template: conda-build.yml@templates +# parameters: +# name: Linux +# vmImage: 'ubuntu-latest' +# py_maj: 3 +# py_min: ${{minor}} +# conda_bld: 3.21.6 -- stage: build_installers - jobs: - - template: constructor-build.yml@templates - parameters: - name: linux - vmImage: 'ubuntu-latest' - - template: constructor-build.yml@templates - parameters: - name: win - vmImage: 'windows-latest' - - template: constructor-build.yml@templates - parameters: - name: macos - vmImage: 'macOS-latest' +# - stage: build_installers +# jobs: +# - template: constructor-build.yml@templates +# parameters: +# name: linux +# vmImage: 'ubuntu-latest' +# - template: constructor-build.yml@templates +# parameters: +# name: win +# vmImage: 'windows-latest' +# - template: constructor-build.yml@templates +# parameters: +# name: macos +# vmImage: 'macOS-latest' -- stage: upload_installers - jobs: - - job: upload_to_github - condition: ne(variables['Build.Reason'], 'PullRequest') - pool: - vmImage: ubuntu-latest - steps: - - download: current - artifact: installer_ubuntu-latest - - download: current - artifact: installer_windows-latest - - download: current - artifact: installer_macOS-latest - - bash: cp $(Pipeline.Workspace)/installer*/*.* . - - task: GitHubRelease@1 - inputs: - gitHubConnection: github.com_oauth - assets: CQ-editor-*.* - action: edit - tag: nightly - target: d8e247d15001bf785ef7498d922b4b5aa017a9c9 - addChangeLog: false - assetUploadMode: replace - isPreRelease: true +# - stage: upload_installers +# jobs: +# - job: upload_to_github +# condition: ne(variables['Build.Reason'], 'PullRequest') +# pool: +# vmImage: ubuntu-latest +# steps: +# - download: current +# artifact: installer_ubuntu-latest +# - download: current +# artifact: installer_windows-latest +# - download: current +# artifact: installer_macOS-latest +# - bash: cp $(Pipeline.Workspace)/installer*/*.* . +# - task: GitHubRelease@1 +# inputs: +# gitHubConnection: github.com_oauth +# assets: CQ-editor-*.* +# action: edit +# tag: nightly +# target: d8e247d15001bf785ef7498d922b4b5aa017a9c9 +# addChangeLog: false +# assetUploadMode: replace +# isPreRelease: true # stage left for debugging, disabled by default -- stage: verify - condition: False - jobs: - - job: verify_linux - pool: - vmImage: ubuntu-latest - steps: - - download: current - artifact: installer_ubuntu-latest - - bash: cp $(Pipeline.Workspace)/installer*/*.* . - - bash: sh ./CQ-editor-master-Linux-x86_64.sh -b -p dummy && cd dummy && ./run.sh +# - stage: verify +# condition: False +# jobs: +# - job: verify_linux +# pool: +# vmImage: ubuntu-latest +# steps: +# - download: current +# artifact: installer_ubuntu-latest +# - bash: cp $(Pipeline.Workspace)/installer*/*.* . +# - bash: sh ./CQ-editor-master-Linux-x86_64.sh -b -p dummy && cd dummy && ./run.sh From 3af49fef003758e158f9a8746eac16aad22fdc6c Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Tue, 10 Jun 2025 08:42:11 -0400 Subject: [PATCH 08/10] Trying to get Appveyor to automatically answer yes to env create questions --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 2824bb6d..47a32fde 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -22,7 +22,7 @@ install: - cmd: set "PATH=%MINICONDA_DIRNAME%;%MINICONDA_DIRNAME%\\Scripts;%PATH%" - cmd: activate - mamba info - - mamba env create --name cqgui -f cqgui_env.yml + - mamba env create -y --name cqgui -f cqgui_env.yml - sh: source activate cqgui - cmd: activate cqgui - mamba list From c4251abb6e61f0c0ff9e2ace3928688374963fca Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Tue, 10 Jun 2025 09:08:06 -0400 Subject: [PATCH 09/10] Trying conda instead of mamba for Appveyor --- appveyor.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 47a32fde..f5325cdc 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -21,13 +21,13 @@ install: - cmd: miniconda.exe /S /InstallationType=JustMe /D=%MINICONDA_DIRNAME% - cmd: set "PATH=%MINICONDA_DIRNAME%;%MINICONDA_DIRNAME%\\Scripts;%PATH%" - cmd: activate - - mamba info - - mamba env create -y --name cqgui -f cqgui_env.yml + - conda info + - conda env create -y --name cqgui -f cqgui_env.yml - sh: source activate cqgui - cmd: activate cqgui - - mamba list - - mamba install -y pytest pluggy pytest-qt - - mamba install -y pytest-mock pytest-cov pytest-repeat codecov pyvirtualdisplay + - conda list + - conda install -y pytest pluggy pytest-qt + - conda install -y pytest-mock pytest-cov pytest-repeat codecov pyvirtualdisplay build: false From 00e8a6141f0317fc63652a55d44105bc89ebf652 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Tue, 10 Jun 2025 14:52:53 -0400 Subject: [PATCH 10/10] Trying to bypass the broken conda package build template --- azure-pipelines.yml | 112 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 86 insertions(+), 26 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c73ffacd..31279626 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,38 +1,98 @@ -# trigger: -# branches: -# include: -# - master -# - refs/tags/* -# exclude: -# - refs/tags/nightly +trigger: + branches: + include: + - master + - refs/tags/* + exclude: + - refs/tags/nightly -# pr: -# - master +pr: +- master # resources: # repositories: # - repository: templates # type: github -# name: CadQuery/conda-packages +# name: jmwright/conda-packages # endpoint: CadQuery -# parameters: -# - name: minor -# type: object -# default: -# - 11 +parameters: + - name: minor + type: object + default: + - 11 + - name: location + type: string + default: 'conda' -# stages: -# - stage: build_conda_package -# jobs: -# - ${{ each minor in parameters.minor }}: -# - template: conda-build.yml@templates -# parameters: -# name: Linux -# vmImage: 'ubuntu-latest' -# py_maj: 3 -# py_min: ${{minor}} -# conda_bld: 3.21.6 +stages: +- stage: build_conda_package + jobs: + - ${{ each minor in parameters.minor }}: + - job: Linux_3_${{ minor }} + timeoutInMinutes: 360 + + pool: + vmImage: ubuntu-latest + + steps: + + # this step is needed for OCC to find fonts + - bash: | + sudo apt-get -q -y install gsfonts xfonts-utils && \ + sudo mkfontscale /usr/share/fonts/type1/gsfonts/ && \ + sudo mkfontdir /usr/share/fonts/type1/gsfonts/ + condition: eq( variables['Agent.OS'], 'Linux' ) + displayName: 'Help OCC find fonts' + + # Ubunut install opengl items + - ${{ if contains('ubuntu-latest', 'Ubuntu') }}: + - bash: | + sudo apt-get update && \ + sudo apt-get -q -y install libglu1-mesa-dev freeglut3-dev mesa-common-dev + displayName: 'Install OpenGL headers' + + - template: conda-enable.yml + parameters: + vmImage: ubuntu-latest + + - bash: conda create --yes --quiet --name build_env -c conda-forge conda-build boa conda-verify libarchive python=3.12 anaconda-client + displayName: Create Anaconda environment + + - bash: | + cd ${{ parameters.location }} && \ + conda run -n build_env conda mambabuild -c conda-forge -c cadquery --output-folder . . && \ + full_path=$(conda run -n build_env conda build --output -c conda-forge -c cadquery --output-folder . . ) && \ + echo $full_path && \ + base_name=$(basename $full_path) && \ + split_name=($(IFS=-; tmp=($base_name); echo ${tmp[@]})) && \ + package_name=${split_name[@]: 0 : ${#split_name[@]} - 2} && \ + package_name=${package_name/ /-} && \ + version_name=${split_name[-2]} && \ + echo "Removing $base_name" && \ + conda run -n build_env anaconda -v -t $TOKEN remove --force "cadquery/$package_name/$version_name" && \ + echo "Uploading $full_path" && \ + conda run -n build_env anaconda -v -t $TOKEN upload -u cadquery --force $full_path && \ + cd .. + displayName: 'Run conda build' + failOnStderr: false + condition: ne(variables['Build.Reason'], 'PullRequest') + env: + PYTHON_VERSION: 3.${{ minor }} + PACKAGE_VERSION: $(Build.SourceBranchName) + TOKEN: $(anaconda.TOKEN) + + - bash: | + cd ${{ parameters.location }} && \ + conda run -n build_env conda mambabuild -c conda-forge -c cadquery . && \ + cd .. + displayName: 'Run conda build without upload' + failOnStderr: false + condition: eq(variables['Build.Reason'], 'PullRequest') + env: + PYTHON_VERSION: 3.${{ minor }} + PACKAGE_VERSION: $(Build.SourceBranchName) + TOKEN: $(anaconda.TOKEN) # - stage: build_installers # jobs: