Skip to content

Commit

Permalink
Revert "Add Windows x64 installer (#165)" (#173)
Browse files Browse the repository at this point in the history
This reverts commit 5e12aaf.

Co-authored-by: Panu Koponen <[email protected]>
  • Loading branch information
pankopon and Panu Koponen authored Feb 8, 2024
1 parent 5e12aaf commit f569ced
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 487 deletions.
69 changes: 5 additions & 64 deletions .azure/pipelines/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ stages:
name: Variables
inputs:
filePath: ./.azure/pipelines/scripts/set-variables.sh
arguments: '$(Build.BuildNumber) $(Build.BuildId)'
arguments: '0.0.0-dev2024.$(Build.BuildId)'
displayName: 'Set up environment variables'

- stage: BuildStage
Expand Down Expand Up @@ -62,16 +62,15 @@ stages:
folderPath: '$(Build.ArtifactStagingDirectory)'
pattern: '$(AICLINuPkgFileName)'
- task: Bash@3
displayName: 'Create Linux installation script'
displayName: 'Create installation script'
inputs:
filePath: ./scripts/InstallAzureAICLIDeb-UpdateVersion.sh
arguments: '$(AICLIVersion) $(Build.StagingDirectory)'
- task: PublishBuildArtifacts@1
- task: PublishPipelineArtifact@1
displayName: Publish artifacts
inputs:
pathToPublish: '$(Build.ArtifactStagingDirectory)'
targetPath: '$(Build.StagingDirectory)'
artifactName: 'ai-cli-artifacts'
artifact: 'ai-cli-artifacts'

- job: Publish
dependsOn: [Build]
Expand All @@ -94,19 +93,12 @@ stages:
arguments: '$(Build.ArtifactStagingDirectory)/$(AICLINuPkgFileName) private/ai/$(AICLINuPkgFileName)'
scriptPath: './.azure/pipelines/scripts/upload-file.sh'
- task: AzureCLI@2
displayName: Upload Linux installation script
displayName: Upload installation script
inputs:
azureSubscription: 'Carbon Dropper (CSSpeechStorage Drop)'
scriptType: 'bash'
arguments: '$(Build.ArtifactStagingDirectory)/InstallAzureAICLIDeb-$(AICLIVersion).sh private/ai/InstallAzureAICLIDeb-$(AICLIVersion).sh'
scriptPath: './.azure/pipelines/scripts/upload-file.sh'
- task: AzureCLI@2
displayName: Upload Windows installer
inputs:
azureSubscription: 'Carbon Dropper (CSSpeechStorage Drop)'
scriptType: 'bash'
arguments: '$(Build.ArtifactStagingDirectory)/Azure-AI-CLI-Setup-$(AICLIVersion)-x64.exe private/ai/Azure-AI-CLI-Setup-$(AICLIVersion)-x64.exe'
scriptPath: './.azure/pipelines/scripts/upload-file.sh'
- task: GithubRelease@1
condition: and(succeeded(), eq(variables['IsRelease'], 'true'))
displayName: Create GitHub release
Expand Down Expand Up @@ -195,57 +187,6 @@ stages:
docker tag acrbn.azurecr.io/azure-ai-cli:bookworm-$(AICLIVersion) acrbn.azurecr.io/azure-ai-cli:latest
docker push acrbn.azurecr.io/azure-ai-cli:latest
- stage: BuildInstallerStage
dependsOn: SetupStage
pool:
name: SkymanWS2022Compliant
jobs:
- job: BuildWindowsInstaller
variables:
AICLIVersion: $[ stageDependencies.SetupStage.SetupJob.outputs['Variables.AICLIVersion']]
AICLISemVerVersion: $[ stageDependencies.SetupStage.SetupJob.outputs['Variables.AICLISemVerVersion']]
steps:
- script: call WixBuildInstaller.cmd $(AICLIVersion) $(AICLISemVerVersion)
workingDirectory: $(Build.SourcesDirectory)/scripts
failOnStderr: true
displayName: Build installation package bundle

- script: call WixRunInsignia.cmd detach x64 $(AICLIVersion)
workingDirectory: $(Build.SourcesDirectory)/scripts
failOnStderr: true
displayName: Detach bundle bootstrap engine

- template: sign-dll-exe.yaml
parameters:
displayName: Sign bundle bootstrap engine
folderPath: '$(Build.SourcesDirectory)/scripts'
pattern: 'engine-*.exe'

- script: call WixRunInsignia.cmd attach x64 $(AICLIVersion)
workingDirectory: $(Build.SourcesDirectory)/scripts
failOnStderr: true
displayName: Re-attach bootstrap bundle engine

- template: sign-dll-exe.yaml
parameters:
displayName: Sign installer
folderPath: '$(Build.SourcesDirectory)/scripts'
pattern: 'Azure-AI-CLI-Setup-*.exe'

- task: CopyFiles@2
inputs:
sourceFolder: '$(Build.SourcesDirectory)/scripts'
contents: 'Azure-AI-CLI-Setup-*.exe'
targetFolder: '$(Build.ArtifactStagingDirectory)'
displayName: Copy files

- task: PublishBuildArtifacts@1
inputs:
pathToPublish: '$(Build.ArtifactStagingDirectory)'
targetPath: '$(Build.StagingDirectory)'
artifactName: 'ai-cli-artifacts'
displayName: Publish artifacts

- stage: TestStage
dependsOn: [SetupStage, BuildStage]
condition: and(succeeded(), or(eq(variables['IsRelease'], 'true'), eq(variables['TestDevBuild'], 'true')))
Expand Down
46 changes: 3 additions & 43 deletions .azure/pipelines/scripts/set-variables.sh
Original file line number Diff line number Diff line change
@@ -1,56 +1,16 @@
#!/bin/bash

define_variable () {
echo "$1=$2"
echo "##vso[task.setvariable variable=$1;isOutput=true]$2"
}

echo "Source branch: $BUILD_SOURCEBRANCH"

# Determine the product version (major.minor.build).
# ref. https://learn.microsoft.com/windows/win32/msi/productversion
# NOTE: If the major or minor version is not updated before a new year, the version number becomes ambiguous
# and it may not be possible to upgrade an old version from the previous year without manual uninstallation.
# Example:
# - last build of year N: 1.0.36599
# - first build of year N+1: 1.0.101 -> cannot update with this, must uninstall 1.0.36599 first.

MAJOR_VERSION="1"
MINOR_VERSION="0"
BUILD_VERSION="0"

# Parse Build.BuildNumber for build date and daily run # (max 99).
# if the user passed in a custom dev branch, use it
if [ ! -z "$1" ]; then
# e.g. "20240120.2" -> build year 2024, month 01, day 20, run 2
BUILD_YEAR=$(echo "$1" | sed 's/^\([0-9]\{4\}\)[0-9]\{4\}\.[0-9]*$/\1/')
BUILD_MONTH=$(echo "$1" | sed 's/^[0-9]\{4\}\([0-9]\{2\}\)[0-9]\{2\}\.[0-9]*$/\1/')
BUILD_DAY=$(echo "$1" | sed 's/^[0-9]\{6\}\([0-9]\{2\}\)\.[0-9]*$/\1/')
BUILD_RUN=$(echo "$1" | sed 's/^[0-9]\{8\}\.\([0-9]*$\)/\1/')

if [ ! -z "$BUILD_MONTH" -a $BUILD_MONTH -ge 1 -a $BUILD_MONTH -le 12 -a \
! -z "$BUILD_DAY" -a $BUILD_DAY -ge 1 -a $BUILD_DAY -le 31 -a \
! -z "$BUILD_RUN" -a $BUILD_RUN -ge 1 -a $BUILD_RUN -le 99 ]
then
let DayOfYear="($BUILD_MONTH - 1) * 31 + $BUILD_DAY" # estimate using max days/month
if [ $BUILD_RUN -lt 10 ]; then
BUILD_VERSION="${DayOfYear}0${BUILD_RUN}"
else
BUILD_VERSION="${DayOfYear}${BUILD_RUN}"
fi
else
>&2 echo "Ignored invalid argument: Build.BuildNumber $1"
fi
fi

PRODUCT_VERSION="${MAJOR_VERSION}.${MINOR_VERSION}.${BUILD_VERSION}"
echo "Product version: $PRODUCT_VERSION"

# Append Build.BuildId to version string.
if [ ! -z "$2" ]; then
BUILD_ID=$2
DEV_VERSION="${PRODUCT_VERSION}-dev${BUILD_YEAR}.${BUILD_ID}"
DEV_VERSION="$1"
else
DEV_VERSION="${PRODUCT_VERSION}-dev${BUILD_YEAR}"
DEV_VERSION="0.0.0-dev"
fi

# If the build was triggered from a tag, use the tag as the version. Otherwise, set the version to dev.
Expand Down
60 changes: 0 additions & 60 deletions .azure/pipelines/sign-dll-exe.yaml

This file was deleted.

79 changes: 0 additions & 79 deletions scripts/Azure-AI-CLI-Bundle.wxs

This file was deleted.

Loading

0 comments on commit f569ced

Please sign in to comment.