2022-12-05 19:59:20 +03:00
|
|
|
# Use the latest 2.1 version of CircleCI pipeline process engine.
|
|
|
|
# See: https://circleci.com/docs/2.0/configuration-reference
|
|
|
|
version: 2.1
|
|
|
|
|
|
|
|
orbs:
|
|
|
|
win: circleci/windows@5.0
|
|
|
|
|
2024-04-08 13:06:44 +03:00
|
|
|
commands:
|
|
|
|
setup_digicert:
|
|
|
|
description: Set up Digicert Keylocker certificate for code-signing
|
|
|
|
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
|
|
|
|
|
2022-12-05 19:59:20 +03:00
|
|
|
jobs:
|
2024-05-29 23:34:03 +03:00
|
|
|
build-visual:
|
|
|
|
docker:
|
|
|
|
- image: cimg/node:18.20.3
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run: node --version
|
|
|
|
- run:
|
|
|
|
name: "npm install"
|
|
|
|
command: "npm i"
|
|
|
|
working_directory: src/powerbi-visual
|
|
|
|
- run:
|
|
|
|
name: Set version
|
|
|
|
command: |
|
|
|
|
npm version ${CIRCLE_TAG:-2.0.0} --allow-same-version
|
|
|
|
working_directory: src/powerbi-visual
|
|
|
|
- run:
|
|
|
|
name: "npm run build"
|
|
|
|
command: "npm run build"
|
|
|
|
working_directory: src/powerbi-visual
|
|
|
|
- run:
|
|
|
|
name: "npm run pack"
|
|
|
|
command: "npm run pack"
|
|
|
|
working_directory: src/powerbi-visual
|
|
|
|
- store_artifacts:
|
|
|
|
path: dist/*.pbiviz
|
|
|
|
- persist_to_workspace:
|
|
|
|
root: ./
|
|
|
|
paths:
|
|
|
|
- src/powerbi-visual/dist/*.pbiviz
|
|
|
|
|
2022-12-05 19:59:20 +03:00
|
|
|
build-connector:
|
|
|
|
executor:
|
|
|
|
name: win/default
|
|
|
|
shell: powershell.exe
|
2024-04-08 13:06:44 +03:00
|
|
|
environment:
|
|
|
|
SSM: 'C:\Program Files\DigiCert\DigiCert One Signing Manager Tools'
|
2022-12-05 19:59:20 +03:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: "Set connector internal version"
|
|
|
|
command: |
|
2024-05-29 23:34:03 +03:00
|
|
|
$env:VERSION = if([string]::IsNullOrEmpty($env:CIRCLE_TAG)) { "2.0.0" } else { $env:CIRCLE_TAG }
|
|
|
|
(Get-Content ./Speckle.pq).replace('[Version = "2.0.0"]', '[Version = "'+$($env:VERSION)+'"]') | Set-Content ./Speckle.pq
|
|
|
|
working_directory: src/powerbi-data-connector
|
2022-12-05 19:59:20 +03:00
|
|
|
- run:
|
|
|
|
name: "Build Data Connector"
|
2024-05-29 23:34:03 +03:00
|
|
|
command: "msbuild Speckle.proj /restore /consoleloggerparameters:NoSummary /property:GenerateFullPaths=true"
|
|
|
|
working_directory: src/powerbi-data-connector
|
2024-04-08 13:06:44 +03:00
|
|
|
- run:
|
|
|
|
name: Create PQX file
|
2024-05-29 13:16:40 +03:00
|
|
|
command: .\tools\MakePQX\MakePQX.exe pack -mz src/powerbi-data-connector/bin/Speckle.mez -t src/powerbi-data-connector/bin/Speckle.pqx
|
2024-05-29 23:34:03 +03:00
|
|
|
- persist_to_workspace:
|
|
|
|
root: ./
|
|
|
|
paths:
|
|
|
|
- src/powerbi-data-connector/bin/Speckle.pqx
|
|
|
|
|
|
|
|
build-installer:
|
|
|
|
executor:
|
|
|
|
name: win/default
|
|
|
|
shell: powershell.exe
|
|
|
|
environment:
|
|
|
|
SSM: 'C:\Program Files\DigiCert\DigiCert One Signing Manager Tools'
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- attach_workspace:
|
|
|
|
at: ./
|
2024-04-08 13:06:44 +03:00
|
|
|
- unless: # Build installers unsigned on non-tagged builds
|
|
|
|
condition: << pipeline.git.tag >>
|
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
name: Build Installer
|
|
|
|
shell: cmd.exe #does not work in powershell
|
|
|
|
environment:
|
|
|
|
WORKFLOW_NUM: << pipeline.number >>
|
2024-05-29 23:34:03 +03:00
|
|
|
CIRCLE_TAG: 2.0.0
|
2024-04-08 13:06:44 +03:00
|
|
|
command: .circleci\build-installer.bat
|
|
|
|
- when: # Setup certificates and build installers signed for tagged builds
|
|
|
|
condition: << pipeline.git.tag >>
|
|
|
|
steps:
|
|
|
|
- setup_digicert
|
|
|
|
- run:
|
|
|
|
name: Build Installer
|
|
|
|
shell: cmd.exe #does not work in powershell
|
|
|
|
environment:
|
|
|
|
WORKFLOW_NUM: << pipeline.number >>
|
|
|
|
command: .circleci\build-installer.bat /DSIGN_INSTALLER /DCODE_SIGNING_CERT_FINGERPRINT=%SM_CODE_SIGNING_CERT_SHA1_HASH%
|
2022-12-05 19:59:20 +03:00
|
|
|
- store_artifacts:
|
2024-05-29 13:16:40 +03:00
|
|
|
path: ./installer
|
2022-12-05 19:59:20 +03:00
|
|
|
- persist_to_workspace:
|
|
|
|
root: ./
|
|
|
|
paths:
|
2024-05-29 13:16:40 +03:00
|
|
|
- installer/*.exe
|
|
|
|
|
2024-04-08 13:06:44 +03:00
|
|
|
deploy-connector-to-feed:
|
|
|
|
docker:
|
|
|
|
- image: mcr.microsoft.com/dotnet/sdk:6.0
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: ./
|
|
|
|
- run:
|
|
|
|
name: Install Manager Feed CLI
|
|
|
|
command: dotnet tool install --global Speckle.Manager.Feed
|
|
|
|
- run:
|
|
|
|
name: Upload new version
|
|
|
|
command: |
|
2024-05-29 23:34:03 +03:00
|
|
|
TAG=$(if [ "${CIRCLE_TAG}" ]; then echo $CIRCLE_TAG; else echo "2.0.0"; fi;)
|
2024-04-08 13:06:44 +03:00
|
|
|
SEMVER=$(echo "$TAG" | sed -e 's/\/[a-zA-Z-]*//')
|
|
|
|
VER=$(echo "$SEMVER" | sed -e 's/-.*//')
|
|
|
|
VERSION=$(echo $VER.$WORKFLOW_NUM)
|
2024-05-29 13:16:40 +03:00
|
|
|
/root/.dotnet/tools/Speckle.Manager.Feed deploy -s powerbi -v ${SEMVER} -u https://releases.speckle.dev/installers/powerbi/powerbi-${SEMVER}.exe -o Win -a Any -f ./installer/powerbi-${SEMVER}.exe
|
2024-04-08 13:06:44 +03:00
|
|
|
environment:
|
|
|
|
WORKFLOW_NUM: << pipeline.number >>
|
2024-05-29 23:34:03 +03:00
|
|
|
|
2022-12-05 19:59:20 +03:00
|
|
|
workflows:
|
|
|
|
build:
|
|
|
|
jobs:
|
2023-01-09 13:55:40 +03:00
|
|
|
- build-connector:
|
2024-04-08 13:06:44 +03:00
|
|
|
context: digicert-keylocker
|
2024-05-29 23:34:03 +03:00
|
|
|
- build-visual
|
|
|
|
- build-installer:
|
|
|
|
context: digicert-keylocker
|
|
|
|
requires:
|
|
|
|
- build-connector
|
|
|
|
- build-visual
|
2022-12-05 19:59:20 +03:00
|
|
|
deploy:
|
|
|
|
jobs:
|
|
|
|
- build-connector:
|
2024-04-08 13:06:44 +03:00
|
|
|
filters: &deploy_filter
|
2022-12-05 19:59:20 +03:00
|
|
|
branches:
|
2024-05-29 23:34:03 +03:00
|
|
|
ignore: /.*/
|
2022-12-05 19:59:20 +03:00
|
|
|
tags:
|
|
|
|
only: /^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-\w{1,10})?$/
|
2024-04-08 13:06:44 +03:00
|
|
|
context: digicert-keylocker
|
2024-05-29 23:34:03 +03:00
|
|
|
- build-visual:
|
|
|
|
filters: *deploy_filter
|
|
|
|
- build-installer:
|
2024-04-08 13:06:44 +03:00
|
|
|
filters: *deploy_filter
|
2024-05-29 23:34:03 +03:00
|
|
|
context: digicert-keylocker
|
2022-12-05 19:59:20 +03:00
|
|
|
requires:
|
|
|
|
- build-connector
|
2024-05-29 23:34:03 +03:00
|
|
|
- build-visual
|
|
|
|
- deploy-connector-to-feed:
|
|
|
|
filters: *deploy_filter
|
|
|
|
requires:
|
|
|
|
- build-installer
|
2024-04-08 13:06:44 +03:00
|
|
|
context: do-spaces-speckle-releases
|