feat: CNX-9628 Add visual to installer and CI script (#74)

* feat: Add visual to installer and CI script (attempt 1)

* fix(ci): Working directory set incorrectly

* fix(ci): Run build before pack and set data connector path correctly

* Install visual tools into dev dependencies

* fix(ci): Try fix MakePQX not found

* fix(ci): MakePQX args need correct subfolder

* fix(visual): Rename visual to not have guid

* feat(ci): Set default version to 2.0.0 everywhere, and overwrite on CI jobs

* fix(ci): Missed one version location

* fix(visual): Always use package.json version

This allows us to `npm version` instead of doing some weirder logic

* fix(visual): Allow same version when bumping
This commit is contained in:
Alan Rynne
2024-05-29 22:34:03 +02:00
committed by GitHub
parent 08554fc864
commit 8031c7da4f
10 changed files with 1872 additions and 389 deletions
+69 -7
View File
@@ -27,6 +27,36 @@ commands:
& $env:SSM\smksp_cert_sync.exe
jobs:
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
build-connector:
executor:
name: win/default
@@ -38,14 +68,31 @@ jobs:
- run:
name: "Set connector internal version"
command: |
$env:VERSION = if([string]::IsNullOrEmpty($env:CIRCLE_TAG)) { "2.0.0.$($env:WORKFLOW_NUM)" } else { $env:CIRCLE_TAG }
(Get-Content ./src/powerbi-data-connector/Speckle.pq).replace('[Version = "2.0.0"]', '[Version = "'+$($env:VERSION)+'"]') | Set-Content ./src/powerbi-data-connector/Speckle.pq
$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
- run:
name: "Build Data Connector"
command: "msbuild ./src/powerbi-data-connector/Speckle.proj /restore /consoleloggerparameters:NoSummary /property:GenerateFullPaths=true"
command: "msbuild Speckle.proj /restore /consoleloggerparameters:NoSummary /property:GenerateFullPaths=true"
working_directory: src/powerbi-data-connector
- run:
name: Create PQX file
command: .\tools\MakePQX\MakePQX.exe pack -mz src/powerbi-data-connector/bin/Speckle.mez -t src/powerbi-data-connector/bin/Speckle.pqx
- 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: ./
- unless: # Build installers unsigned on non-tagged builds
condition: << pipeline.git.tag >>
steps:
@@ -54,7 +101,7 @@ jobs:
shell: cmd.exe #does not work in powershell
environment:
WORKFLOW_NUM: << pipeline.number >>
CIRCLE_TAG: 2.0.999-beta/all
CIRCLE_TAG: 2.0.0
command: .circleci\build-installer.bat
- when: # Setup certificates and build installers signed for tagged builds
condition: << pipeline.git.tag >>
@@ -85,29 +132,44 @@ jobs:
- run:
name: Upload new version
command: |
TAG=$(if [ "${CIRCLE_TAG}" ]; then echo $CIRCLE_TAG; else echo "2.0.999"; fi;)
TAG=$(if [ "${CIRCLE_TAG}" ]; then echo $CIRCLE_TAG; else echo "2.0.0"; 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 powerbi -v ${SEMVER} -u https://releases.speckle.dev/installers/powerbi/powerbi-${SEMVER}.exe -o Win -a Any -f ./installer/powerbi-${SEMVER}.exe
environment:
WORKFLOW_NUM: << pipeline.number >>
workflows:
build:
jobs:
- build-connector:
context: digicert-keylocker
- build-visual
- build-installer:
context: digicert-keylocker
requires:
- build-connector
- build-visual
deploy:
jobs:
- build-connector:
filters: &deploy_filter
branches:
ignore: /.*/ # For testing only: /ci\/.*/
ignore: /.*/
tags:
only: /^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-\w{1,10})?$/
context: digicert-keylocker
- build-visual:
filters: *deploy_filter
- build-installer:
filters: *deploy_filter
context: digicert-keylocker
requires:
- build-connector
- build-visual
- deploy-connector-to-feed:
filters: *deploy_filter
requires:
- build-connector
- build-installer
context: do-spaces-speckle-releases
+2 -1
View File
@@ -339,4 +339,5 @@ ASALocalRun/
**/.tmp/
**/webpack.statistics.*.html
**/webpack.statistics.html
**/Thumbs.db
**/Thumbs.db
installer/
+1 -1
View File
@@ -1,4 +1,4 @@
[Version = "2.15.0-rc"]
[Version = "2.0.0"]
section Speckle;
AuthAppId = "spklpwerbi";
+44 -42
View File
@@ -1,45 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
DefaultTargets="BuildMez">
<PropertyGroup>
<Version Condition="'$(Version)' == ''">2.0.0-wip</Version>
<OutputPath Condition="'$(OutputPath)' == ''">$(MSBuildProjectDirectory)\bin\</OutputPath>
<IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">
$(MSBuildProjectDirectory)\obj\</IntermediateOutputPath>
<MezIntermediatePath>$(IntermediateOutputPath)MEZ\</MezIntermediatePath>
<MezOutputPath>$(OutputPath)$(MsBuildProjectName).mez</MezOutputPath>
</PropertyGroup>
<ItemGroup>
<MezContent Include="Speckle.pq" />
<MezContent Include="utilities\**\*.pqm" />
<MezContent Include="speckle\**\*.pqm" />
<MezContent Include="assets\SpeckleLogo16.png" />
<MezContent Include="assets\SpeckleLogo20.png" />
<MezContent Include="assets\SpeckleLogo24.png" />
<MezContent Include="assets\SpeckleLogo32.png" />
<MezContent Include="assets\SpeckleLogo40.png" />
<MezContent Include="assets\SpeckleLogo48.png" />
<MezContent Include="assets\SpeckleLogo64.png" />
<MezContent Include="assets\SpeckleLogo80.png" />
<MezContent Include="assets\resources.resx" />
</ItemGroup>
<Target Name="BuildMez" AfterTargets="Build" Inputs="@(MezContent)" Outputs="$(MezOutputPath)">
<RemoveDir Directories="$(MezIntermediatePath)" />
<Copy SourceFiles="@(MezContent)" DestinationFolder="$(MezIntermediatePath)" />
<MakeDir Directories="$(OutputPath)" Condition="!Exists('$(OutputPath)')" />
<ZipDirectory SourceDirectory="$(MezIntermediatePath)" DestinationFile="$(MezOutputPath)"
Overwrite="true" />
</Target>
<Target Name="CopyToConnectors" AfterTargets="BuildMez">
<Message
Text="Copying .mez file to: $(UserProfile)\Documents\Power BI Desktop\Custom Connectors"
Importance="High" />
<MakeDir Directories="$(UserProfile)\Documents\Power BI Desktop\Custom Connectors\" />
<Copy SourceFiles="$(MezOutputPath)"
DestinationFolder="$(UserProfile)\Documents\Power BI Desktop\Custom Connectors\" />
</Target>
<Target Name="Clean">
<RemoveDir Directories="$(MezIntermediatePath)" />
<Delete Files="$(MezOutputPath)" />
</Target>
DefaultTargets="BuildMez">
<PropertyGroup>
<Version Condition="'$(Version)' == ''">2.0.0-wip</Version>
<OutputPath Condition="'$(OutputPath)' == ''">$(MSBuildProjectDirectory)\bin\</OutputPath>
<IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">
$(MSBuildProjectDirectory)\obj\</IntermediateOutputPath>
<MezIntermediatePath>$(IntermediateOutputPath)MEZ\</MezIntermediatePath>
<MezOutputPath>$(OutputPath)$(MsBuildProjectName).mez</MezOutputPath>
<IsContinuousIntegrationBuild>false</IsContinuousIntegrationBuild>
</PropertyGroup>
<ItemGroup>
<MezContent Include="Speckle.pq" />
<MezContent Include="utilities\**\*.pqm" />
<MezContent Include="speckle\**\*.pqm" />
<MezContent Include="assets\SpeckleLogo16.png" />
<MezContent Include="assets\SpeckleLogo20.png" />
<MezContent Include="assets\SpeckleLogo24.png" />
<MezContent Include="assets\SpeckleLogo32.png" />
<MezContent Include="assets\SpeckleLogo40.png" />
<MezContent Include="assets\SpeckleLogo48.png" />
<MezContent Include="assets\SpeckleLogo64.png" />
<MezContent Include="assets\SpeckleLogo80.png" />
<MezContent Include="assets\resources.resx" />
</ItemGroup>
<Target Name="BuildMez" AfterTargets="Build" Inputs="@(MezContent)" Outputs="$(MezOutputPath)">
<RemoveDir Directories="$(MezIntermediatePath)" />
<Copy SourceFiles="@(MezContent)" DestinationFolder="$(MezIntermediatePath)" />
<MakeDir Directories="$(OutputPath)" Condition="!Exists('$(OutputPath)')" />
<ZipDirectory SourceDirectory="$(MezIntermediatePath)" DestinationFile="$(MezOutputPath)"
Overwrite="true" />
</Target>
<Target Name="CopyToConnectors" AfterTargets="BuildMez"
Condition="$(IsContinuousIntegrationBuild) == 'false'">
<Message
Text="Copying .mez file to: $(UserProfile)\Documents\Power BI Desktop\Custom Connectors"
Importance="High" />
<MakeDir Directories="$(UserProfile)\Documents\Power BI Desktop\Custom Connectors\" />
<Copy SourceFiles="$(MezOutputPath)"
DestinationFolder="$(UserProfile)\Documents\Power BI Desktop\Custom Connectors\" />
</Target>
<Target Name="Clean">
<RemoveDir Directories="$(MezIntermediatePath)" />
<Delete Files="$(MezOutputPath)" />
</Target>
</Project>
+1739 -330
View File
File diff suppressed because it is too large Load Diff
+4 -1
View File
@@ -7,6 +7,7 @@
},
"license": "MIT",
"scripts": {
"pbiviz": "pbiviz",
"pack": "webpack --config webpack.config.ts",
"build": "webpack --config webpack.config.dev.ts",
"serve": "webpack-dev-server --config webpack.config.dev.ts"
@@ -57,6 +58,7 @@
"mini-css-extract-plugin": "^2.7.5",
"postcss": "^8.4.23",
"postcss-import": "^15.1.0",
"powerbi-visuals-tools": "^5.4.3",
"powerbi-visuals-webpack-plugin": "^4.0.0",
"prettier": "^2.8.8",
"style-loader": "^3.3.2",
@@ -73,5 +75,6 @@
"webpack-bundle-analyzer": "^4.8.0",
"webpack-cli": "^5.1.1",
"webpack-dev-server": "^4.15.0"
}
},
"version": "2.0.0"
}
+2 -2
View File
@@ -2,9 +2,9 @@
"visual": {
"name": "Speckle PowerBI Viewer",
"displayName": "Speckle PowerBI Viewer",
"guid": "powerbiSpeckleVisualAA98F06515D847E8ACB33BAB487244E0",
"guid": "specklePowerBiVisual",
"visualClassName": "Visual",
"version": "2.19.0",
"version": "2.0.0",
"description": "An interactive 3D viewer for Speckle Data",
"supportUrl": "https://speckle.community",
"gitHubUrl": "https://github.com/specklesystems/speckle-powerbi-visuals"
+3
View File
@@ -20,6 +20,9 @@ const powerbiApi: any = powerbi // Types for PowerBI seem to be off, so I'm inst
const pbivizPath = './pbiviz.json'
const pbivizFile = require(path.join(__dirname, pbivizPath))
const packageJsonFile = require(path.join(__dirname, 'package.json'))
pbivizFile.visual.version = packageJsonFile.version
// the visual capabilities content
const capabilitiesPath = './capabilities.json'
const capabilitiesFile = require(path.join(__dirname, capabilitiesPath))
+3
View File
@@ -20,6 +20,9 @@ const powerbiApi: any = powerbi // Types for PowerBI seem to be off, so I'm inst
const pbivizPath = './pbiviz.json'
const pbivizFile = require(path.join(__dirname, pbivizPath))
const packageJsonFile = require(path.join(__dirname, 'package.json'))
pbivizFile.visual.version = packageJsonFile.version
// the visual capabilities content
const capabilitiesPath = './capabilities.json'
const capabilitiesFile = require(path.join(__dirname, capabilitiesPath))
+5 -5
View File
@@ -5,13 +5,14 @@
#define BasePath "..\"
#define Bin BasePath + "src\powerbi-data-connector\bin\"
#define VisualDistPath BasePath + "src\powerbi-data-connector\dist\"
#define VisualDistPath BasePath + "src\powerbi-visual\dist\"
#ifndef Version
#define Version "2.0.999"
#define Version "2.0.0"
#endif
#ifndef InfoVersion
#define InfoVersion "2.0.999.9999"
#define InfoVersion "2.0.0.0"
#endif
#define AppPublisher "Speckle"
@@ -56,7 +57,7 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
Source: "{#Bin}Speckle.pqx"; DestDir: "{#CustomConnectorFolder}";
; Source: "{#VisualDistPath}/specklePowerBiVisual.*.pbiviz"; DestDir: "{#CustomVisualFolder}";
Source: "{#VisualDistPath}specklePowerBiVisual.{#Version}.pbiviz"; DestDir: "{#CustomVisualFolder}"; DestName: specklePowerBiVisual.pbiviz;
; TODO: Including the thumbprint in the registry will enable this running in higher security environments.
; Currently blocked because of MakePQX.exe not being ready to work with online CSP's like Digicert Keylocker.
@@ -65,4 +66,3 @@ Source: "{#Bin}Speckle.pqx"; DestDir: "{#CustomConnectorFolder}";
[InstallDelete]
; Remove old .mez file connector to prevent conflicts with prior versions.
Type: filesandordirs; Name: "{#CustomConnectorFolder}\Speckle.mez"
Type: filesandordirs; Name: "{#CustomConnectorFolder}\Speckle.mez"