From 3780fb7ff56fde3aa6d19b6a7c029ae2c2e9d9cf Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Fri, 10 May 2024 09:08:19 +0100 Subject: [PATCH] try only correct action and no circle ci --- .circleci/config.yml | 66 --- .circleci/scripts/common-jobs.yml | 4 - .circleci/scripts/config-generator.py | 236 --------- .circleci/scripts/config-template.yml | 675 -------------------------- .circleci/scripts/connector-jobs.yml | 208 -------- .circleci/scripts/parameters.json | 12 - .github/workflows/dotnet.yml | 2 +- 7 files changed, 1 insertion(+), 1202 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100644 .circleci/scripts/common-jobs.yml delete mode 100644 .circleci/scripts/config-generator.py delete mode 100644 .circleci/scripts/config-template.yml delete mode 100644 .circleci/scripts/connector-jobs.yml delete mode 100644 .circleci/scripts/parameters.json diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index f623d0046f..0000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,66 +0,0 @@ -version: 2.1 - -# this allows you to use CircleCI's dynamic configuration feature -setup: true - -# the path-filtering orb is required to continue a pipeline based on -# the path of an updated fileset -orbs: - path-filtering: circleci/path-filtering@0.1.3 - continuation: circleci/continuation@0.3.1 - python: circleci/python@2.0.3 - -jobs: - setup: - executor: python/default - steps: - - checkout # checkout code - - when: - condition: - and: - - not: - equal: [main, << pipeline.git.branch >>] - - not: - matches: - pattern: ".*/?ci/.*" - value: << pipeline.git.branch >> - - not: - matches: - pattern: ".*/all$" - value: << pipeline.git.tag >> - steps: - - run: git branch internal_circleci - # - path-filtering/set-parameters: - # mapping: | - # Core/.* core true - # (Core|Objects|ConnectorRhino|ConnectorGrasshopper|.*/ConverterRhinoGh)/.* rhino true - # (Core|Objects|ConnectorRevit|.*/ConverterRevit)/.* revit true - # (Core|Objects|ConnectorDynamo|.*/ConverterDynamo)/.* dynamo true - # (Core|Objects|ConnectorAutocadCivil|.*/ConverterAutocadCivil)/.* autocadcivil true - # (Core|Objects|ConnectorCSI|.*/ConverterCSI)/.* csi true - # (Core|Objects|ConnectorBentley|.*/ConverterBentley)/.* bentley true - # (Core|Objects|ConnectorTeklaStructures|.*/ConverterTeklaStructures)/.* teklastructures true - # (Core|Objects|ConnectorArchicad)/.* archicad true - # (Core|Objects|ConnectorNavisworks|.*/ConverterNavisworks)/.* navisworks true - # base-revision: main - # output-path: .circleci/scripts/parameters.json - - run: cat .circleci/scripts/parameters.json - - run: pip install pyyaml - - run: # run a command - name: Generate config - command: | - python .circleci/scripts/config-generator.py -d ${CIRCLE_TAG:-none} -o .circleci/continuation-config.yml -e ${CIRCLE_PR_REPONAME:-none} - - continuation/continue: - configuration_path: .circleci/continuation-config.yml # use newly generated config to continue -workflows: - setup: - jobs: - - setup: - name: Build Setup - - setup: - name: Deploy Setup - filters: - branches: - ignore: /.*/ - tags: - only: /^(nugets\/)?([0-9]+)\.([0-9]+)\.([0-9]+)(?:-\w+)?(\/all)?$/ diff --git a/.circleci/scripts/common-jobs.yml b/.circleci/scripts/common-jobs.yml deleted file mode 100644 index 53eac01827..0000000000 --- a/.circleci/scripts/common-jobs.yml +++ /dev/null @@ -1,4 +0,0 @@ -core: - - test-core: - requires: - - build-sdk diff --git a/.circleci/scripts/config-generator.py b/.circleci/scripts/config-generator.py deleted file mode 100644 index b74cbda16e..0000000000 --- a/.circleci/scripts/config-generator.py +++ /dev/null @@ -1,236 +0,0 @@ -import json -from re import S -from typing import Any, Dict, List -import yaml -import sys -import getopt - - -def runCommand(argv: List[str]): - - deploy: bool = False - external_build: bool = False - output_filepath: str = ".circleci/continuation-config.yml" - arg_help = "{0} -d -o ".format(argv[0]) - - print(argv) - try: - opts, _ = getopt.getopt(argv[1:], "hd:o:e:") - except: - print(arg_help) - sys.exit(2) - - for opt, arg in opts: - if opt in ("-h", "--help"): - print(arg_help) # print the help message - sys.exit(2) - elif opt in ("-d", "--deploy"): - deploy = arg is not None and arg not in [ - "none", - "None", - "False", - "false", - "f", - ] - print("deploy arg -- " + str(arg) + " -- " + str(deploy)) - elif opt in ("-o", "--output"): - output_filepath = arg - elif opt in ("-e", "--external"): - external_build = arg is not None and arg not in [ - "none", - "None", - "False", - "false", - "f", - ] - print("Building for external PR " + str(external_build)) - createConfigFile(deploy, output_filepath, external_build) - - -def setup(): - # Grab the parameters file - with open(".circleci/scripts/parameters.json", "r") as f: - global params - params = json.load(f) - - # Grab the template configuration - with open(".circleci/scripts/config-template.yml", "r") as yf: - global config - config = yaml.safe_load(yf) - - # Grab available connector jobs - with open(".circleci/scripts/connector-jobs.yml", "r") as cf: - global connector_jobs - connector_jobs = yaml.safe_load(cf) - - with open(".circleci/scripts/common-jobs.yml", "r") as cf: - global common_jobs - common_jobs = yaml.safe_load(cf) - - -def getTagRegexString(connector_names: List[str]) -> str: - # Version format 'x.y.z' with optional suffix '-{SUFFIX_NAME}' and optional '/all' ending to force build all tags - return "/^([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-\\w+)?(\\/all)?$/" - - -def getTagFilter(connector_names: List[str]): - return { - "branches": {"ignore": "/.*/"}, - "tags": {"only": getTagRegexString(connector_names)}, - } - - -def createConfigFile(deploy: bool, outputPath: str, external_build: bool): - print("---- Started creating config ----") - print( - f"\n -- Settings --\n Deploy: {deploy}\n Output path: {outputPath}\n External build: {external_build}\n --\n" - ) - setup() - - # Get the main workflow - main_workflow = config["workflows"]["build"] - - build_core = False - if "core" in params.keys(): - build_core = params["core"] - - jobs_before_deploy: List[str] = [] - slugs_to_match: List[str] = [] - for connector, run in params.items(): - # Add any common jobs first - if connector in common_jobs.keys(): - common_jobs_to_run = common_jobs[connector] - main_workflow["jobs"] += common_jobs_to_run - print(f"Added common jobs: {connector}") - - # Add connector jobs - if run and connector in connector_jobs.keys(): - print(f"Started adding connector jobs: {connector}") - - # Get jobs to run per connector - jobs_to_run = connector_jobs[connector] - if connector not in slugs_to_match: - slugs_to_match.append(connector) - # Setup each job - for j in jobs_to_run: - # Job only has one key with the job name - job_name = next(iter(j.keys())) - jobAttrs = j[job_name] - - # Add common requirements only to connector jobs. - is_connector_job = job_name.find("build-connector") >= 0 - if is_connector_job: - # Get the slug - slug = ( - connector if "slug" not in jobAttrs.keys() else jobAttrs["slug"] - ) - - # Make sure you've initialized the 'requires' item - if "requires" not in jobAttrs.keys(): - jobAttrs["requires"] = [] - # Require objects to build for all connectors - jobAttrs["requires"] += ["build-sdk"] - - # Add name to all jobs - name = f"{slug}-build" - if "name" not in jobAttrs.keys(): - jobAttrs["name"] = name - n = jobAttrs["name"] - jobs_before_deploy.append(n) - print(f" Added connector job: {n}") - if deploy: - jobAttrs["filters"] = getTagFilter([connector]) - - # Append connector jobs to main workflow jobs - main_workflow["jobs"] += connector_jobs[connector] - if build_core: - # Require core tests too if core needs rebuilding. - jobs_before_deploy.append("test-core") - # Modify jobs for deployment - if deploy: - deploy_job = {} - deploy_job["filters"] = getTagFilter(slugs_to_match) - deploy_job["requires"] = jobs_before_deploy - main_workflow["jobs"] += [{"deploy-connectors": deploy_job}] - print("Added deploy job: deployment") - - if main_workflow["jobs"][0]["get-ci-tools"] != None: - main_workflow["jobs"].pop(0) - - ci_tools_job = { - "filters": getTagFilter(slugs_to_match), - "context": "github-dev-bot", - } - main_workflow["jobs"] += [{"get-ci-tools": ci_tools_job}] - print("Modified job for deploy: get-ci-tools") - - for job in main_workflow["jobs"]: - x = list(job.keys()) - jobAttrs = job[x[0]] - if "filters" not in jobAttrs.keys(): - jobAttrs["filters"] = getTagFilter(slugs_to_match) - print(f"Added missing filter to job: {x[0]}") - - jobsToWait = [] - for jobName in jobs_before_deploy: - if jobName == "test-core": - continue - job = getNewDeployJob(jobName) - if job["deploy-connector-new"]: - jobsToWait.append(job["deploy-connector-new"]["name"]) - main_workflow["jobs"] += [job] - main_workflow["jobs"] += [ - { - "notify-deploy": { - "requires": jobsToWait, - "context": "discord", - "filters": getTagFilter(slugs_to_match), - } - } - ] - if external_build: - removeStepsThatUseSecrets(config) - # Output continuation file - with open(outputPath, "w") as file: - yaml.dump(config, file, sort_keys=False) - - print("---- Finished creating config ----") - - -def removeStepsThatUseSecrets(config): - jobs: dict[str, dict[str, dict]] = config["workflows"]["build"]["jobs"] - filteredJobs = [] - - for jobItem in jobs: - key = next(iter(jobItem.keys())) - if key == "get-ci-tools": - continue - jobDict: dict = jobItem[key] - requires = jobDict["requires"] - if requires: - if "get-ci-tools" in requires: - requires.pop(requires.index("get-ci-tools")) - filteredJobs.append({f"{key}": jobDict}) - - config["workflows"]["build"]["jobs"] = filteredJobs - print("Cleaned up config for external build") - - -def getNewDeployJob(jobName: str): - slug: str = jobName.split("-build")[0] - isMac: bool = jobName.find("-mac") != -1 - deployJob: Dict[str, Any] = { - "slug": slug.split("-mac")[0] if isMac else slug, - "name": slug + "-deploy-mac" if isMac else slug + "-deploy", - "os": "OSX" if isMac else "Win", - "arch": "Any", - "extension": "zip" if isMac else "exe", - "requires": ["deploy-connectors", jobName], - "filters": getTagFilter([jobName]), - "context": ["do-spaces-speckle-releases"], - } - return {"deploy-connector-new": deployJob} - - -if __name__ == "__main__": - runCommand(sys.argv) diff --git a/.circleci/scripts/config-template.yml b/.circleci/scripts/config-template.yml deleted file mode 100644 index 35aa609d88..0000000000 --- a/.circleci/scripts/config-template.yml +++ /dev/null @@ -1,675 +0,0 @@ -version: 2.1 - -orbs: - win: circleci/windows@5.0.0 - aws-s3: circleci/aws-s3@2.0.0 - codecov: codecov/codecov@3.2.2 - wait-for: cobli/wait-for@0.0.2 - discord: antonioned/discord@0.1.0 - docker: circleci/docker@2.2.0 - -# The main workflows for our monorepo pipeline. - -workflows: - build: - jobs: - - get-ci-tools: - context: github-dev-bot - - build-sdk: - requires: - - get-ci-tools - build-dui3: - jobs: - - build-dui3-job - nuget: - jobs: - - build-sdk: - name: nuget-deploy-core - filters: - branches: - ignore: /.*/ - tags: - only: /^(nuget-core|nugets)\/([0-9]+)\.([0-9]+)\.([0-9]+)(?:-\w{1,10})?$/ - post-steps: - - packandpublish - context: nuget - -commands: - cached-checkout: - steps: - - checkout - - # Leaving this here to investigate further but currently IT DOES NOT WORK - # BASH_ENV says it doesn't exist or I don't have access to it. - set-version-vars: - steps: - - run: - name: Set version environment variables - command: | - echo 'export TAG=$(if [ "${CIRCLE_TAG}" ]; then echo $CIRCLE_TAG; else echo "2.0.999"; fi;)' >> "$BASH_ENV" - echo 'export SEMVER=$(echo "$TAG" | sed -e 's/\/[a-zA-Z-]*//')' >> "$BASH_ENV" - echo 'export VER=$(echo "$SEMVER" | sed -e 's/-.*//')' >> "$BASH_ENV" - echo 'export VERSION=$(echo $VER.$WORKFLOW_NUM)' >> "$BASH_ENV" - environment: - WORKFLOW_NUM: << pipeline.number >> - - packandpublish: - steps: - - run: - name: Build nuget packages - command: | - TAG=$(if [ "${CIRCLE_TAG}" ]; then echo $CIRCLE_TAG; else echo "2.0.999"; fi;) - NOPREFIX=$(echo $TAG | sed -e 's/^[a-zA-Z]*\///') - SEMVER=$(echo "$NOPREFIX" | sed -e 's/\/[a-zA-Z-]*//') - VER=$(echo "$SEMVER" | sed -e 's/-.*//') - VERSION=$(echo $VER.$WORKFLOW_NUM) - $HOME/.dotnet/dotnet pack All.sln -p:Version=$SEMVER -p:FileVersion=$VERSION -c Release -p:IsDesktopBuild=false - environment: - WORKFLOW_NUM: << pipeline.number >> - - run: - name: Push nuget packages - command: $HOME/.dotnet/dotnet nuget push "**/*.nupkg" -s https://api.nuget.org/v3/index.json -k $NUGET_APIKEY -n --skip-duplicate - - run-tests: - parameters: - project: - type: string - title: - type: string - steps: - - run: - name: << parameters.title >> - command: $HOME/.dotnet/dotnet test << parameters.project >> - -c Release - -p:IsDesktopBuild=false - --logger:"junit;LogFileName={assembly}.results.xml" - --results-directory=TestResults - --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover - -jobs: # Each project will have individual jobs for each specific task it has to execute (build, release...) - build-dui3-job: - executor: - name: win/default - shell: powershell.exe - steps: - - checkout - - run: - name: Enforce formatting - command: | - dotnet tool restore - dotnet csharpier --check . - - run: - name: Dotnet Restore - command: | - dotnet restore DUI3-DX.slnf - - run: - name: Build DUI3 Solution filter - command: | - msbuild DUI3-DX.slnf /p:Configuration=Release /p:IsDesktopBuild=false - build-sdk: - docker: - - image: cimg/base:2021.01 - steps: - - cached-checkout - - run: - name: Install dotnet - command: | - curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel sts - $HOME/.dotnet/dotnet --version - - run: - name: Enforce formatting - command: | - $HOME/.dotnet/dotnet tool restore - $HOME/.dotnet/dotnet csharpier --check . - - run: - name: Build SDK Projects - command: | - TAG=$(if [ "${CIRCLE_TAG}" ]; then echo $CIRCLE_TAG; else echo "2.0.999"; fi;) - NOPREFIX=$(echo $TAG | sed -e 's/^[a-zA-Z]*\///') - SEMVER=$(echo "$NOPREFIX" | sed -e 's/\/[a-zA-Z-]*//') - VER=$(echo "$SEMVER" | sed -e 's/-.*//') - VERSION=$(echo $VER.$WORKFLOW_NUM) - $HOME/.dotnet/dotnet build SDK.slnf -c Release -p:IsDesktopBuild=false -p:Version=$SEMVER -p:FileVersion=$VERSION - environment: - WORKFLOW_NUM: << pipeline.number >> - - run-tests: - title: Core Unit Tests - project: Core/Tests/Speckle.Core.Tests.Unit/Speckle.Core.Tests.Unit.csproj - - run-tests: - title: Objects Unit Tests - project: Objects/Tests/Objects.Tests.Unit/Objects.Tests.Unit.csproj - - store_test_results: - path: TestResults - - test-core: - machine: - image: ubuntu-2204:2023.02.1 - resource_class: large - steps: - - cached-checkout - - run: - name: Install dotnet - command: | - curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel sts - $HOME/.dotnet/dotnet --version - - run: - name: Startup the Speckle Server - command: docker compose -f Core/docker-compose.yml up -d - - run-tests: - title: Core Integration Tests - project: Core/Tests/Speckle.Core.Tests.Integration/Speckle.Core.Tests.Integration.csproj - - run-tests: - title: Automate Integration Tests - project: Automate/Tests/Speckle.Automate.Sdk.Tests.Integration/Speckle.Automate.Sdk.Tests.Integration.csproj - - store_test_results: - path: TestResults - - build-connector: # Reusable job for basic connectors - executor: - name: win/default - shell: powershell.exe - parameters: - slnname: - type: string - projname: - type: string - default: "" - dllname: - type: string - slug: - type: string - default: "" - build-with-msbuild: - type: boolean - default: true - installer: - type: boolean - default: false - environment: - SSM: 'C:\Program Files\DigiCert\DigiCert One Signing Manager Tools' - steps: - - cached-checkout - - attach_workspace: - at: ./ - - run: - name: Restore << parameters.slnname >> - command: nuget restore << parameters.slnname >>/<< parameters.slnname >>.sln - - when: - condition: << parameters.build-with-msbuild >> - steps: - - run: - name: Build << parameters.slnname >> - command: | - $tag = if([string]::IsNullOrEmpty($env:CIRCLE_TAG)) { "2.0.999" } else { $env:CIRCLE_TAG } - $semver = if($tag.Contains('/')) {$tag.Split("/")[0] } else { $tag } - $ver = if($semver.Contains('-')) {$semver.Split("-")[0] } else { $semver } - $version = "$($ver).$($env:WORKFLOW_NUM)" - msbuild << parameters.slnname >>/<< parameters.slnname >>.sln /p:Configuration=Release /p:IsDesktopBuild=false /p:Version=$semver /p:FileVersion=$version - environment: - WORKFLOW_NUM: << pipeline.number >> - - unless: - condition: << parameters.build-with-msbuild >> - steps: - - run: - name: Build << parameters.slnname >> - command: | - $tag = if([string]::IsNullOrEmpty($env:CIRCLE_TAG)) { "2.0.999" } else { $env:CIRCLE_TAG } - $semver = if($tag.Contains('/')) {$tag.Split("/")[0] } else { $tag } - $ver = if($semver.Contains('-')) {$semver.Split("-")[0] } else { $semver } - $version = "$($ver).$($env:WORKFLOW_NUM)" - dotnet publish << parameters.slnname >>/<< parameters.slnname >>/<< parameters.projname >>.csproj -c Release -r win-x64 --self-contained /p:IsDesktopBuild=false /p:Version=$semver /p:FileVersion=$version - environment: - WORKFLOW_NUM: << pipeline.number >> - - run: - name: Exit if External PR - shell: bash.exe - command: if [ "$CIRCLE_PR_REPONAME" ]; then circleci-agent step halt; fi - - 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\%SLUG%.iss /Sbyparam=$p - shell: cmd.exe #does not work in powershell - environment: - SLUG: << parameters.slug >> - - 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: Setup Digicert ONE Client 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\smksp_cert_sync.exe - - run: - name: Build Installer - command: speckle-sharp-ci-tools\InnoSetup\ISCC.exe speckle-sharp-ci-tools\%SLUG%.iss /Sbyparam=$p /DSIGN_INSTALLER /DCODE_SIGNING_CERT_FINGERPRINT=%SM_CODE_SIGNING_CERT_SHA1_HASH% - shell: cmd.exe #does not work in powershell - environment: - SLUG: << parameters.slug >> - - persist_to_workspace: - root: ./ - paths: - - speckle-sharp-ci-tools/Installers - - deploy-connector-new: - docker: - - image: mcr.microsoft.com/dotnet/sdk:6.0 - parameters: - slug: - type: string - os: - type: string - extension: - type: string - arch: - type: string - default: Any - steps: - - attach_workspace: - at: ./ - - run: - name: Install Manager Feed CLI - command: dotnet tool install --global Speckle.Manager.Feed - - run: - name: Upload new version - command: | - TAG=$(if [ "${CIRCLE_TAG}" ]; then echo $CIRCLE_TAG; else echo "2.0.999"; fi;) - SEMVER=$(echo "$TAG" | sed -e 's/\/[a-zA-Z-]*//') - VER=$(echo "$SEMVER" | sed -e 's/-.*//') - VERSION=$(echo $VER.$WORKFLOW_NUM) - /root/.dotnet/tools/Speckle.Manager.Feed deploy -s << parameters.slug >> -v ${SEMVER} -u https://releases.speckle.dev/installers/<< parameters.slug >>/<< parameters.slug >>-${SEMVER}.<< parameters.extension >> -o << parameters.os >> -a << parameters.arch >> -f speckle-sharp-ci-tools/Installers/<< parameters.slug >>/<< parameters.slug >>-${SEMVER}.<< parameters.extension >> - environment: - WORKFLOW_NUM: << pipeline.number >> - - build-connector-mac: - macos: - xcode: 12.5.1 - parameters: - slnname: - type: string - projname: - type: string - default: "" - slug: - type: string - default: "" - installer: - type: boolean - default: false - converter-files: - type: string - default: "" - installername: - type: string - default: "" - build-config: - type: string - default: Release - build-with-mono: - type: boolean - default: true - bundlename: - type: string - default: "" - steps: - - cached-checkout - - attach_workspace: - at: ./ - - run: - name: Install dotnet - command: | - curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel sts - - $HOME/.dotnet/dotnet --version - $HOME/.dotnet/dotnet --list-runtimes - $HOME/.dotnet/dotnet --list-sdks - - when: - condition: << parameters.build-with-mono >> - steps: - - run: - name: Install mono - command: | - HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1 brew install mono mono-libgdiplus - - run: - name: Create installer target dir - command: | - mkdir -p speckle-sharp-ci-tools/Installers/<< parameters.slug >> - - when: - condition: << parameters.build-with-mono >> - steps: - - run: - name: Build << parameters.slnname >> - command: | - TAG=$(if [ "${CIRCLE_TAG}" ]; then echo $CIRCLE_TAG; else echo "2.0.999"; fi;) - SEMVER=$(echo "$TAG" | sed -e 's/\/[a-zA-Z-]*//') - VER=$(echo "$SEMVER" | sed -e 's/-.*//') - VERSION=$(echo $VER.$WORKFLOW_NUM) - msbuild << parameters.slnname >>/<< parameters.slnname >>.sln /r /p:Configuration='<< parameters.build-config >>' /p:IsDesktopBuild=false /p:Version=$SEMVER /p:FileVersion=$VERSION - environment: - WORKFLOW_NUM: << pipeline.number >> - # Compress build files - - run: - name: Zip Objects Kit files - command: | - zip -j Objects.zip << parameters.converter-files >> - - run: - name: Zip Connector files - command: | - cd << parameters.slnname >>/<< parameters.projname >>/bin/ - zip -r <>.zip ./ - # Copy installer files - - run: - name: Copy files to installer - command: | - mkdir -p speckle-sharp-ci-tools/Mac/<>/.installationFiles/ - cp Objects.zip speckle-sharp-ci-tools/Mac/<>/.installationFiles - cp << parameters.slnname >>/<< parameters.projname >>/bin/<>.zip speckle-sharp-ci-tools/Mac/<>/.installationFiles - - unless: - condition: << parameters.build-with-mono >> - steps: - - run: - name: Publish x64 and arm64 - command: | - TAG=$(if [ "${CIRCLE_TAG}" ]; then echo $CIRCLE_TAG; else echo "2.0.999"; fi;) - SEMVER=$(echo "$TAG" | sed -e 's/\/[a-zA-Z-]*//') - VER=$(echo "$SEMVER" | sed -e 's/-.*//') - VERSION=$(echo $VER.$WORKFLOW_NUM) - $HOME/.dotnet/dotnet publish << parameters.slnname >>/<< parameters.projname >>/<< parameters.projname >>.csproj -c Release -r osx-arm64 --self-contained /p:IsDesktopBuild=false /p:Version=$SEMVER /p:FileVersion=$VERSION - $HOME/.dotnet/dotnet publish << parameters.slnname >>/<< parameters.projname >>/<< parameters.projname >>.csproj -c Release -r osx-x64 --self-contained /p:IsDesktopBuild=false /p:Version=$SEMVER /p:FileVersion=$VERSION - environment: - WORKFLOW_NUM: << pipeline.number >> - - run: - name: Zip Connector files - command: | - cd "<< parameters.slnname >>/<< parameters.slnname >>/bin/Release/net6.0/osx-arm64/publish" - zip -r << parameters.slug >>-mac-arm64.zip "./" - cd "../../osx-x64/publish" - zip -r << parameters.slug >>-mac-x64.zip "./" - # Copy installer files - - run: - name: Copy files to installer - command: | - mkdir -p speckle-sharp-ci-tools/Mac/<< parameters.installername >>/.installationFiles/ - cp << parameters.slnname >>/<< parameters.slnname >>/bin/Release/net6.0/osx-arm64/publish/<< parameters.slug >>-mac-arm64.zip speckle-sharp-ci-tools/Mac/<>/.installationFiles - cp << parameters.slnname >>/<< parameters.slnname >>/bin/Release/net6.0/osx-x64/publish/<< parameters.slug >>-mac-x64.zip speckle-sharp-ci-tools/Mac/<>/.installationFiles - # Create installer - - run: - name: Exit if External PR - command: if [ "$CIRCLE_PR_REPONAME" ]; then circleci-agent step halt; fi - - run: - name: Build Mac installer - command: ~/.dotnet/dotnet publish speckle-sharp-ci-tools/Mac/<>/<>.sln -r osx-x64 -c Release - - run: - name: Zip installer - command: | - cd speckle-sharp-ci-tools/Mac/<>/bin/Release/net6.0/osx-x64/publish/ - zip -r <>.zip ./ - - store_artifacts: - path: speckle-sharp-ci-tools/Mac/<>/bin/Release/net6.0/osx-x64/publish/<>.zip - - run: - name: Copy to installer location - command: | - TAG=$(if [ "${CIRCLE_TAG}" ]; then echo $CIRCLE_TAG; else echo "2.0.999"; fi;) - SEMVER=$(echo "$TAG" | sed -e 's/\/[a-zA-Z-]*//') - VER=$(echo "$SEMVER" | sed -e 's/-.*//') - VERSION=$(echo $VER.$WORKFLOW_NUM) - cp speckle-sharp-ci-tools/Mac/<>/bin/Release/net6.0/osx-x64/publish/<>.zip speckle-sharp-ci-tools/Installers/<< parameters.slug >>/<>-$SEMVER.zip - environment: - WORKFLOW_NUM: << pipeline.number >> - - when: - condition: << pipeline.git.tag >> - steps: - - persist_to_workspace: - root: ./ - paths: - - speckle-sharp-ci-tools/Installers - - build-connector-dotnet-mac: - docker: - - image: mcr.microsoft.com/dotnet/sdk:7.0 - parameters: - slnname: - type: string - projname: - type: string - default: "" - slug: - type: string - default: "" - converter-files: - type: string - default: "" - installername: - type: string - default: "" - build-config: - type: string - default: Release - steps: - - cached-checkout - - attach_workspace: - at: ./ - - run: - name: Create installer target directory - command: | - mkdir -p speckle-sharp-ci-tools/Installers/<< parameters.slug >> - - run: - name: Build - command: | - TAG=$(if [ "${CIRCLE_TAG}" ]; then echo $CIRCLE_TAG; else echo "2.0.999"; fi;) - SEMVER=$(echo "$TAG" | sed -e 's/\/[a-zA-Z-]*//') - VER=$(echo "$SEMVER" | sed -e 's/-.*//') - VERSION=$(echo $VER.$WORKFLOW_NUM) - dotnet build << parameters.slnname >>/<< parameters.slnname >>.slnf -c "<< parameters.build-config >>" -p:Version=$SEMVER -p:FileVersion=$VERSION -p:IsDesktopBuild=false - environment: - WORKFLOW_NUM: << pipeline.number >> - - run: - name: Install Zip - command: | - apt-get update -y - apt-get install zip -y - - run: - name: Zip Objects Kit files - command: | - zip -j Objects.zip << parameters.converter-files >> - - run: - name: Zip Connector files - command: | - cd << parameters.slnname >>/<< parameters.projname >>/bin/ - zip -r <>.zip ./ - - run: - name: Copy files to installer - command: | - mkdir -p speckle-sharp-ci-tools/Mac/<>/.installationFiles/ - cp Objects.zip speckle-sharp-ci-tools/Mac/<>/.installationFiles - cp << parameters.slnname >>/<< parameters.projname >>/bin/<>.zip speckle-sharp-ci-tools/Mac/<>/.installationFiles - # Create installer - - run: - name: Exit if External PR - command: if [ "$CIRCLE_PR_REPONAME" ]; then circleci-agent step halt; fi - - run: - name: Build Mac installer - command: dotnet publish speckle-sharp-ci-tools/Mac/<>/<>.sln -r osx-x64 -c Release - - run: - name: Zip installer - command: | - cd speckle-sharp-ci-tools/Mac/<>/bin/Release/net6.0/osx-x64/publish/ - zip -r <>.zip ./ - - store_artifacts: - path: speckle-sharp-ci-tools/Mac/<>/bin/Release/net6.0/osx-x64/publish/<>.zip - - run: - name: Copy to installer location - command: | - TAG=$(if [ "${CIRCLE_TAG}" ]; then echo $CIRCLE_TAG; else echo "2.0.999"; fi;) - SEMVER=$(echo "$TAG" | sed -e 's/\/[a-zA-Z-]*//') - VER=$(echo "$SEMVER" | sed -e 's/-.*//') - VERSION=$(echo $VER.$WORKFLOW_NUM) - cp speckle-sharp-ci-tools/Mac/<>/bin/Release/net6.0/osx-x64/publish/<>.zip speckle-sharp-ci-tools/Installers/<< parameters.slug >>/<>-$SEMVER.zip - environment: - WORKFLOW_NUM: << pipeline.number >> - - when: - condition: << pipeline.git.tag >> - steps: - - persist_to_workspace: - root: ./ - paths: - - speckle-sharp-ci-tools/Installers - - get-ci-tools: # Clones our ci tools and persists them to the workspace - docker: - - image: cimg/base:2021.01 - steps: - - add_ssh_keys: - fingerprints: - - "62:b2:1a:86:b7:9f:83:91:9b:61:f8:52:66:38:78:64" - - run: - name: I know Github as a host - command: | - mkdir ~/.ssh - 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: - name: Checkout branch - command: | - cd speckle-sharp-ci-tools - if [ -z "$CIRCLE_TAG" ] - then - git checkout ${CIRCLE_BRANCH} || git checkout main - else - git checkout ${CIRCLE_TAG} || git checkout main - fi - - - persist_to_workspace: - root: ./ - paths: - - speckle-sharp-ci-tools - - build-archicad-add-on: # build Archicad C++ add-on - parameters: - archicadversion: - type: string - default: "" - executor: - name: win/server-2019 - shell: bash.exe - version: 2023.04.1 # Version 2023.08.01 broke this step due to missing MSVC v142 C++ build tools. Fixed to the prior working version till a fix is issued. - steps: - - cached-checkout - - attach_workspace: - at: ./ - - run: - name: Install cmake - command: | - choco install cmake -y - - run: - name: Get Archicad devkit - command: | - mkdir Resources - cd Resources - curl -o Archicad<>DevKit.zip https://releases.speckle.dev/build-utils/Archicad<>DevKit.zip - unzip Archicad<>DevKit.zip -d Archicad<>DevKit - - run: - name: Generate cmake files - command: | - cd ConnectorArchicad/AddOn - mkdir Build.Win.x64.<> - export PATH=$PATH:"C:\Program Files\CMake\bin" - cmake -B "./Build.Win.x64.<>/" -A "x64" -T "v142" -DAC_API_DEVKIT_DIR="../../Resources/Archicad<>DevKit" -DAC_MDID_DEV=${GRAPHISOFT_DEV_ID:-1} -DAC_MDID_LOC=${GRAPHISOFT_ADDON_ID:-1} - - run: - name: Build add-on - command: | - cd ConnectorArchicad/AddOn - "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/MSBuild.exe" "Build.Win.x64.<>/Speckle Connector.sln" -property:Configuration=Release - - persist_to_workspace: - root: ./ - paths: - - ConnectorArchicad/AddOn/Build.Win.x64.<> - - build-archicad-add-on-mac: # build Archicad C++ add-on - macos: - xcode: 12.5.1 - parameters: - archicadversion: - type: string - default: "" - slug: - type: string - default: "" - installername: - type: string - default: "" - steps: - - cached-checkout - - attach_workspace: - at: ./ - - run: - name: Install cmake - command: | - HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1 brew install cmake - - run: - name: Get Archicad devkit - command: | - mkdir Resources - cd Resources - curl -o Archicad<>DevKitMac.zip https://releases.speckle.dev/build-utils/Archicad<>DevKitMac.zip - unzip Archicad<>DevKitMac.zip -d Archicad<>DevKitMac - - run: - name: Generate cmake files - command: | - cd ConnectorArchicad/AddOn - mkdir Build.macOS.x64.<> - cmake -B "./Build.macOS.x64.<>/" -G 'Xcode' -DCMAKE_OSX_ARCHITECTURES=x86_64 -DAC_API_DEVKIT_DIR="../../Resources/Archicad<>DevKitMac" -DAC_MDID_DEV=${GRAPHISOFT_DEV_ID:-1} -DAC_MDID_LOC=${GRAPHISOFT_ADDON_ID:-1} - - run: - name: Build add-on - command: | - cd ConnectorArchicad/AddOn - xcodebuild -scheme ALL_BUILD -configuration Release -project Build.macOS.x64.<>/Speckle\ Connector.xcodeproj build - # Compress build files - - run: - name: Zip Connector files - command: | - cd ConnectorArchicad/AddOn/Build.macOS.x64.<< parameters.archicadversion >>/Release - zip -r << parameters.slug >>-<< parameters.archicadversion >>-mac.zip ./Speckle\ Connector.bundle - # Copy installer files - - run: - name: Copy files to installer - command: | - mkdir -p speckle-sharp-ci-tools/Mac/<< parameters.installername >>/.installationFiles/ - cp ConnectorArchicad/AddOn/Build.macOS.x64.<< parameters.archicadversion >>/Release/<< parameters.slug >>-<>-mac.zip speckle-sharp-ci-tools/Mac/<< parameters.installername >>/.installationFiles - - persist_to_workspace: - root: ./ - paths: - - speckle-sharp-ci-tools/Mac/<< parameters.installername >>/.installationFiles/ - - deploy-connectors: # Uploads all installers found to S3 - docker: - - image: cimg/base:2021.01 - steps: - - run: - name: Proceed to deploy - command: echo "This step is just here to wait for all build jobs before proceeding to deploy each of them individually. If a job fails, no connector will be deployed." - - notify-deploy: - docker: - - image: cimg/base:2021.01 - steps: - - discord/status: - mentions: "1067457311980933140" - success_message: - ":tada: a new version of Speckle-Sharp connectors was build - successfully!" - failure_message: ":red_circle: oh no! Speckle-Sharp connectors build has failed!" diff --git a/.circleci/scripts/connector-jobs.yml b/.circleci/scripts/connector-jobs.yml deleted file mode 100644 index e5e31974cd..0000000000 --- a/.circleci/scripts/connector-jobs.yml +++ /dev/null @@ -1,208 +0,0 @@ -# This file contains the individual jobs each connector must run to build/deploy. -# Each application should have its own entry as a list of jobs. -# These jobs will be pulled into the 'config-template.yml' file when needed. -# The name of each build step will be set using the "slug" - -rhino: - - build-connector: - slnname: ConnectorRhino - dllname: SpeckleConnectorRhino.rhp - slug: rhino - context: - - digicert-keylocker - - build-connector: - slnname: ConnectorRhino - dllname: SpeckleConnectorRhino.rhp - slug: grasshopper - context: - - digicert-keylocker - - build-connector-dotnet-mac: - name: rhino-build-mac - slnname: ConnectorRhino - projname: ConnectorRhino7 - installername: SpeckleRhinoInstall - build-config: Release Mac - slug: rhino - converter-files: " - Objects/Converters/ConverterRhinoGh/ConverterRhino7/bin/Release/net48/Objects.dll - Objects/Converters/ConverterRhinoGh/ConverterRhino7/bin/Release/net48/Objects.Converter.Rhino7.dll - Objects/Converters/ConverterRhinoGh/ConverterRhino6/bin/Release/netstandard2.0/Objects.Converter.Rhino6.dll - Objects/Converters/ConverterRhinoGh/ConverterGrasshopper7/bin/Release/net48/Objects.Converter.Grasshopper7.dll - Objects/Converters/ConverterRhinoGh/ConverterGrasshopper6/bin/Release/netstandard2.0/Objects.Converter.Grasshopper6.dll - " - - build-connector-dotnet-mac: - name: grasshopper-build-mac - slnname: ConnectorRhino - projname: ConnectorRhino7 - build-config: Release Mac - installername: SpeckleGHInstall - slug: grasshopper - converter-files: " - Objects/Converters/ConverterRhinoGh/ConverterRhino7/bin/Release/net48/Objects.dll - Objects/Converters/ConverterRhinoGh/ConverterRhino7/bin/Release/net48/Objects.Converter.Rhino7.dll - Objects/Converters/ConverterRhinoGh/ConverterRhino6/bin/Release/netstandard2.0/Objects.Converter.Rhino6.dll - Objects/Converters/ConverterRhinoGh/ConverterGrasshopper7/bin/Release/net48/Objects.Converter.Grasshopper7.dll - Objects/Converters/ConverterRhinoGh/ConverterGrasshopper6/bin/Release/netstandard2.0/Objects.Converter.Grasshopper6.dll - " -dynamo: - - build-connector: - slnname: ConnectorDynamo - dllname: SpeckleConnectorDynamo.dll - slug: dynamo - context: - - digicert-keylocker - -revit: - - build-connector: - slnname: ConnectorRevit - dllname: SpeckleConnectorRevit.dll - slug: revit - context: - - digicert-keylocker - -autocadcivil: - - build-connector: - slnname: ConnectorAutocadCivil - dllname: SpeckleConnectorAutocad.dll - slug: autocad - context: - - digicert-keylocker - - build-connector: - slnname: ConnectorAutocadCivil - dllname: SpeckleConnectorAutocad.dll - slug: civil3d - context: - - digicert-keylocker - - build-connector: - slnname: ConnectorAutocadCivil - dllname: SpeckleConnectorAutocad.dll - slug: advancesteel - context: - - digicert-keylocker -bentley: - - build-connector: - slnname: ConnectorBentley - dllname: SpeckleConnectorMicroStation.dll - slug: microstation - context: - - digicert-keylocker - - build-connector: - slnname: ConnectorBentley - dllname: SpeckleConnectorOpenBuildings.dll - slug: openbuildings - context: - - digicert-keylocker - - build-connector: - slnname: ConnectorBentley - dllname: SpeckleConnectorOpenRail.dll - slug: openrail - context: - - digicert-keylocker - - build-connector: - slnname: ConnectorBentley - dllname: SpeckleConnectorOpenRoads.dll - slug: openroads - context: - - digicert-keylocker - -teklastructures: - - build-connector: - slnname: ConnectorTeklaStructures - dllname: SpeckleConnectorTeklaStructures.dll - slug: teklastructures - context: - - digicert-keylocker -csi: - - build-connector: - slnname: ConnectorCSI - dllname: SpeckleConnectorCSI.dll - slug: etabs - context: - - digicert-keylocker - - build-connector: - slnname: ConnectorCSI - dllname: SpeckleConnectorCSI.dll - slug: sap2000 - context: - - digicert-keylocker - - build-connector: - slnname: ConnectorCSI - dllname: SpeckleConnectorCSI.dll - slug: safe - context: - - digicert-keylocker - - build-connector: - slnname: ConnectorCSI - dllname: SpeckleConnectorCSI.dll - slug: csibridge - context: - - digicert-keylocker - -archicad: - - build-archicad-add-on: - archicadversion: "25" - requires: - - get-ci-tools - name: build-archicad-add-on-25 - - build-archicad-add-on: - archicadversion: "26" - requires: - - get-ci-tools - name: build-archicad-add-on-26 - - build-archicad-add-on: - archicadversion: "27" - requires: - - get-ci-tools - name: build-archicad-add-on-27 - - build-connector: - requires: - - build-archicad-add-on-25 - - build-archicad-add-on-26 - - build-archicad-add-on-27 - slnname: ConnectorArchicad - projname: ConnectorArchicad - dllname: ConnectorArchicad.dll - slug: archicad - build-with-msbuild: false - context: - - digicert-keylocker - - build-archicad-add-on-mac: - archicadversion: "25" - requires: - - get-ci-tools - name: build-archicad-add-on-25-mac - slug: archicad - installername: SpeckleArchicadInstall - - build-archicad-add-on-mac: - archicadversion: "26" - requires: - - get-ci-tools - name: build-archicad-add-on-26-mac - slug: archicad - installername: SpeckleArchicadInstall - - build-archicad-add-on-mac: - archicadversion: "27" - requires: - - get-ci-tools - name: build-archicad-add-on-27-mac - slug: archicad - installername: SpeckleArchicadInstall - - build-connector-mac: - name: archicad-build-mac - requires: - - build-archicad-add-on-25-mac - - build-archicad-add-on-26-mac - - build-archicad-add-on-27-mac - slnname: ConnectorArchicad - projname: ConnectorArchicad - slug: archicad - build-with-mono: false - installername: SpeckleArchicadInstall - -navisworks: - - build-connector: - slnname: ConnectorNavisworks - dllname: SpeckleConnectorNavisworks.dll - slug: navisworks - context: - - digicert-keylocker diff --git a/.circleci/scripts/parameters.json b/.circleci/scripts/parameters.json deleted file mode 100644 index 3530ba7244..0000000000 --- a/.circleci/scripts/parameters.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "core": true, - "rhino": true, - "revit": true, - "dynamo": true, - "csi": true, - "autocadcivil": true, - "bentley": true, - "archicad": true, - "teklastructures": true, - "navisworks": true -} diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index ddafdd92e6..a6eb2582b0 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -5,7 +5,7 @@ name: .NET on: pull_request: - branches: ["dui3/alpha"] + branches: ["dui3/alpha". "dui3/ci/github-actions-test"] jobs: build: