ffd4da1ed9
* Poetry update * Updated runner * bump poetry again * require export * Fixed Digicerts broken sync certs
332 lines
10 KiB
YAML
332 lines
10 KiB
YAML
version: 2.1
|
|
|
|
orbs:
|
|
win: circleci/windows@5.0.0
|
|
|
|
jobs:
|
|
package-connector:
|
|
docker:
|
|
- image: cimg/python:3.11.12
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Setup SEMVER value
|
|
command: |
|
|
SEMVER=$(if [ "${CIRCLE_TAG}" ]; then echo $CIRCLE_TAG; else echo "0.0.0"; fi;)
|
|
echo $SEMVER > ./SEMVER
|
|
python3 patch_version.py $SEMVER
|
|
- run:
|
|
name: install dependencies
|
|
command: poetry install --only main
|
|
- run:
|
|
name: export package dependencies
|
|
command: ./export_dependencies.sh
|
|
- persist_to_workspace:
|
|
root: ./
|
|
paths:
|
|
- bpy_speckle
|
|
- patch_installer.py
|
|
- SEMVER
|
|
|
|
build-connector-zip:
|
|
docker:
|
|
- image: cimg/python:3.11.12
|
|
steps:
|
|
- attach_workspace:
|
|
at: ./
|
|
- run: &restore_semver
|
|
name: Restore Semver
|
|
command: SEMVER=$(cat ./SEMVER) && echo $SEMVER
|
|
- run:
|
|
name: Package to Zip
|
|
command: zip -r bpy_speckle.zip bpy_speckle
|
|
- persist_to_workspace:
|
|
root: ./
|
|
paths:
|
|
- bpy_speckle.zip
|
|
|
|
get-ci-tools: # Clones our ci tools and persists them to the workspace
|
|
docker:
|
|
- image: cimg/base:2025.04
|
|
steps:
|
|
- add_ssh_keys:
|
|
fingerprints:
|
|
- "77:64:03:93:c5:f3:1d:a6:fd:bd:fb:d1:05:56:ca:e9"
|
|
- run:
|
|
name: I know Github as a host
|
|
command: |
|
|
mkdir ~/.ssh
|
|
touch ~/.ssh/known_hosts
|
|
ssh-keyscan github.com >> ~/.ssh/known_hosts
|
|
- run:
|
|
name: Clone
|
|
command: git clone git@github.com:specklesystems/speckle-sharp-ci-tools.git speckle-sharp-ci-tools
|
|
- run:
|
|
command: cd speckle-sharp-ci-tools
|
|
- persist_to_workspace:
|
|
root: ./
|
|
paths:
|
|
- speckle-sharp-ci-tools
|
|
|
|
build-installer-win:
|
|
executor:
|
|
name: win/default
|
|
environment:
|
|
SSM: 'C:\Program Files\DigiCert\DigiCert One Signing Manager Tools'
|
|
steps:
|
|
- attach_workspace:
|
|
at: ./
|
|
- run:
|
|
name: Patch installer
|
|
command: python patch_installer.py (Get-Content -Raw SEMVER)
|
|
- unless: # Build installers unsigned on non-tagged builds
|
|
condition: << pipeline.git.tag >>
|
|
steps:
|
|
- run:
|
|
name: Build Installer
|
|
command: speckle-sharp-ci-tools\InnoSetup\ISCC.exe speckle-sharp-ci-tools\blender.iss /Sbyparam=$p
|
|
shell: cmd.exe #does not work in powershell
|
|
- when: # Setup certificates and build installers signed for tagged builds
|
|
condition: << pipeline.git.tag >>
|
|
steps:
|
|
- run:
|
|
name: "Digicert Signing Manager Setup"
|
|
command: |
|
|
cd C:\
|
|
curl.exe -X GET https://one.digicert.com/signingmanager/api-ui/v1/releases/smtools-windows-x64.msi/download -H "x-api-key:$env:SM_API_KEY" -o smtools-windows-x64.msi
|
|
msiexec.exe /i smtools-windows-x64.msi /quiet /qn | Wait-Process
|
|
- run:
|
|
name: Create Auth & OV Signing Cert
|
|
command: |
|
|
cd C:\
|
|
echo $env:SM_CLIENT_CERT_FILE_B64 > certificate.txt
|
|
certutil -decode certificate.txt certificate.p12
|
|
- run:
|
|
name: Sync Certs
|
|
command: |
|
|
& $env:SSM\smctl.exe windows certsync
|
|
- run:
|
|
name: Build Installer
|
|
command: speckle-sharp-ci-tools\InnoSetup\ISCC.exe speckle-sharp-ci-tools\blender.iss /Sbyparam=$p /DSIGN_INSTALLER /DCODE_SIGNING_CERT_FINGERPRINT=%SM_CODE_SIGNING_CERT_SHA1_HASH%
|
|
shell: cmd.exe #does not work in powershell
|
|
- persist_to_workspace:
|
|
root: ./
|
|
paths:
|
|
- speckle-sharp-ci-tools/Installers/blender/blender-*.exe
|
|
|
|
build-installer-mac:
|
|
macos:
|
|
xcode: 13.4.1
|
|
resource_class: macos.m1.medium.gen1
|
|
parameters:
|
|
runtime:
|
|
type: string
|
|
slug:
|
|
type: string
|
|
installer_path:
|
|
type: string
|
|
default: speckle-sharp-ci-tools/Mac/SpeckleBlenderInstall
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: ./
|
|
- run:
|
|
name: Exit if External PR
|
|
command: if [ "$CIRCLE_PR_REPONAME" ]; then circleci-agent step halt; fi
|
|
- run:
|
|
name: Install mono
|
|
command: |
|
|
HOMEBREW_NO_AUTO_UPDATE=1 brew install mono
|
|
# Compress build files
|
|
- run:
|
|
name: Install dotnet
|
|
command: curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin
|
|
- run: *restore_semver
|
|
- run:
|
|
name: Copy connector files to installer
|
|
command: |
|
|
mkdir -p <<parameters.installer_path >>/.installationFiles/
|
|
cp bpy_speckle.zip << parameters.installer_path >>/.installationFiles
|
|
- run:
|
|
name: Build Mac installer
|
|
command: ~/.dotnet/dotnet publish << parameters.installer_path >>/SpeckleBlenderInstall.sln -r << parameters.runtime >> -c Release
|
|
- run:
|
|
name: Zip installer
|
|
command: |
|
|
SEMVER=$(cat ./SEMVER)
|
|
echo $SEMVER
|
|
mkdir -p speckle-sharp-ci-tools/Installers/blender
|
|
(cd <<parameters.installer_path>>/bin/Release/net6.0/<< parameters.runtime >>/publish/ && zip -r - ./) > << parameters.slug >>-${SEMVER}.zip
|
|
cp << parameters.slug >>-${SEMVER}.zip speckle-sharp-ci-tools/Installers/blender/
|
|
|
|
- persist_to_workspace:
|
|
root: ./
|
|
paths:
|
|
- speckle-sharp-ci-tools/Installers/blender/<< parameters.slug >>*.zip
|
|
|
|
build-installer-manual:
|
|
docker:
|
|
- image: cimg/base:2025.04
|
|
parameters:
|
|
slug:
|
|
type: string
|
|
default: bpy_speckle
|
|
steps:
|
|
- attach_workspace:
|
|
at: ./
|
|
- run: *restore_semver
|
|
- run:
|
|
name: Copy zip with semver
|
|
command: |
|
|
SEMVER=$(cat ./SEMVER)
|
|
mkdir -p speckle-sharp-ci-tools/Installers/blender
|
|
cp bpy_speckle.zip speckle-sharp-ci-tools/Installers/blender/<< parameters.slug >>-${SEMVER}.zip
|
|
- persist_to_workspace:
|
|
root: ./
|
|
paths:
|
|
- speckle-sharp-ci-tools/Installers/blender/<< parameters.slug >>*.zip
|
|
|
|
deploy-connector:
|
|
docker:
|
|
- image: mcr.microsoft.com/dotnet/sdk:6.0
|
|
parameters:
|
|
file_slug:
|
|
type: string
|
|
os:
|
|
type: string
|
|
extension:
|
|
type: string
|
|
arch:
|
|
type: string
|
|
default: Any
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: ./
|
|
- run:
|
|
name: Install Manager Feed CLI
|
|
command: dotnet tool install --global Speckle.Manager.Feed
|
|
- run: *restore_semver
|
|
- run:
|
|
name: Upload new version
|
|
# this is where the installer gets the semver baked into the file name
|
|
command: |
|
|
SEMVER=$(cat ./SEMVER)
|
|
echo $SEMVER
|
|
/root/.dotnet/tools/Speckle.Manager.Feed deploy \
|
|
-s blender \
|
|
-v ${SEMVER} \
|
|
-u https://releases.speckle.dev/installers/blender/<< parameters.file_slug >>-${SEMVER}.<< parameters.extension >> \
|
|
-o << parameters.os >> \
|
|
-a << parameters.arch >> \
|
|
-f speckle-sharp-ci-tools/Installers/blender/<< parameters.file_slug >>-${SEMVER}.<< parameters.extension >>
|
|
|
|
workflows:
|
|
build: # build the installers, but don't persist to workspace for deployment
|
|
jobs:
|
|
- package-connector:
|
|
filters: &build_filters
|
|
tags:
|
|
only: /([0-9]+)\.([0-9]+)\.([0-9]+)(?:-\w+)?(?:\.[0-9]+)?/
|
|
|
|
- build-connector-zip:
|
|
requires:
|
|
- package-connector
|
|
filters: *build_filters
|
|
|
|
- get-ci-tools:
|
|
filters: *build_filters
|
|
|
|
- build-installer-win:
|
|
context: digicert-keylocker
|
|
name: Windows Installer Build
|
|
requires:
|
|
- package-connector
|
|
- get-ci-tools
|
|
filters: *build_filters
|
|
|
|
- deploy-connector:
|
|
context: do-spaces-speckle-releases
|
|
name: deploy-windows
|
|
file_slug: blender
|
|
os: WIN
|
|
arch: Any
|
|
extension: exe
|
|
requires:
|
|
- Manual Installer Build
|
|
- Windows Installer Build
|
|
- Mac Intel Build
|
|
- Mac ARM Build
|
|
filters: &deploy_filters
|
|
branches:
|
|
ignore: /.*/
|
|
tags:
|
|
only: /([0-9]+)\.([0-9]+)\.([0-9]+)(?:-\w+)?(?:\.[0-9]+)?/
|
|
|
|
- build-installer-mac:
|
|
name: Mac ARM Build
|
|
slug: blender-mac-arm
|
|
runtime: osx-arm64
|
|
requires:
|
|
- get-ci-tools
|
|
- build-connector-zip
|
|
filters: *build_filters
|
|
|
|
- deploy-connector:
|
|
context: do-spaces-speckle-releases
|
|
name: deploy-mac-arm
|
|
file_slug: blender-mac-arm
|
|
os: OSX
|
|
arch: Arm
|
|
extension: zip
|
|
requires:
|
|
- Manual Installer Build
|
|
- Windows Installer Build
|
|
- Mac Intel Build
|
|
- Mac ARM Build
|
|
filters: *deploy_filters
|
|
|
|
- build-installer-mac:
|
|
name: Mac Intel Build
|
|
slug: blender-mac-intel
|
|
runtime: osx-x64
|
|
requires:
|
|
- get-ci-tools
|
|
- build-connector-zip
|
|
filters: *build_filters
|
|
|
|
- deploy-connector:
|
|
context: do-spaces-speckle-releases
|
|
name: deploy-mac-intel
|
|
file_slug: blender-mac-intel
|
|
os: OSX
|
|
arch: Intel
|
|
extension: zip
|
|
requires:
|
|
- Manual Installer Build
|
|
- Windows Installer Build
|
|
- Mac Intel Build
|
|
- Mac ARM Build
|
|
filters: *deploy_filters
|
|
|
|
- build-installer-manual:
|
|
name: Manual Installer Build
|
|
requires:
|
|
- get-ci-tools
|
|
- build-connector-zip
|
|
filters: *build_filters
|
|
|
|
- deploy-connector:
|
|
context: do-spaces-speckle-releases
|
|
name: deploy-manual
|
|
file_slug: bpy_speckle
|
|
os: Any
|
|
arch: Any
|
|
extension: zip
|
|
requires:
|
|
- Manual Installer Build
|
|
- Windows Installer Build
|
|
- Mac Intel Build
|
|
- Mac ARM Build
|
|
filters: *deploy_filters
|