forked from microsoft/WSL-DistroLauncher
-
Notifications
You must be signed in to change notification settings - Fork 105
/
azure-pipelines.yml
137 lines (121 loc) · 4.21 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# Universal Windows Platform
# Build a Universal Windows Platform project using Visual Studio.
# Add steps that test and distribute an app, save build artifacts, and more:
# https://aka.ms/yaml
trigger:
batch: true
branches:
include: [ master ]
pool:
vmImage: 'windows-2022'
variables:
solution: '**/*.sln'
buildPlatform: 'x64|ARM64'
buildConfiguration: 'Release'
appxPackageDir: '$(System.DefaultWorkingDirectory)\AppxPackages'
steps:
- task: DownloadSecureFile@1
name: circleToken
inputs:
secureFile: 'circle-token.txt'
- task: Bash@3
displayName: Download and move 64 bit ARM image
inputs:
targetType: 'inline'
script: |
# Tried with secure variable without success (bug?) so I am using secureFiles
CIRCLE_TOKEN="$(cat "${CIRCLE_TOKEN_FILE}")"
url=$(curl -H "Circle-Token: ${CIRCLE_TOKEN}" https://circleci.com/api/v1.1/project/github/WhitewaterFoundry/pengwin-rootfs-builds/latest/artifacts | grep -o 'https://[^"]*')
mkdir -p ARM64
curl -L -H "Circle-Token: ${CIRCLE_TOKEN}" "${url}" --output ARM64/install.tar.gz
env:
CIRCLE_TOKEN_FILE: $(circleToken.secureFilePath)
- task: DownloadBuildArtifacts@0
displayName: Download 64 bit image
inputs:
buildType: 'specific'
project: '84ac49ca-47e0-4979-b8ee-cd1cf8fe4e74'
pipeline: '1'
specificBuildWithTriggering: true
buildVersionToDownload: 'latest'
downloadType: 'single'
artifactName: 'drop'
downloadPath: '$(System.ArtifactsDirectory)'
- task: CmdLine@2
displayName: Move 64 bit image
inputs:
script: |
move $(System.ArtifactsDirectory)\drop\install_amd64_rootfs.tar.gz x64\install.tar.gz
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: DownloadSecureFile@1
name: signingCert
inputs:
secureFile: 'store.pfx'
- task: Bash@3
inputs:
targetType: 'inline'
script: |
version=$(sed -n -E '/^ +Version=/s/^ +Version="([0-9\.]*)(.*)/\1/p' Pengwin/Package.appxmanifest)
sed -E -i "s/(^.*commandline.*16571368D6CFF_)([0-9\.]+)(_x64)(_.*$)/\1${version}_x64\4/" x64/pengwin.json
sed -E -i "s/(^.*icon.*16571368D6CFF_)([0-9\.]+)(_x64)(_.*$)/\1${version}_x64\4/" x64/pengwin.json
sed -E -i "s/(^.*backgroundImage.*16571368D6CFF_)([0-9\.]+)(_x64)(_.*$)/\1${version}_x64\4/" x64/pengwin.json
cp x64/pengwin.json ARM64/pengwin.json
sed -E -i "s/_x64_/_arm64_/g" ARM64/pengwin.json
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/t:Pengwin /m /p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload /p:PackageCertificateThumbprint="" /p:PackageCertificateKeyFile="$(signingCert.secureFilePath)" /p:PackageCertificatePassword="1"'
platform: 'x64'
configuration: '$(buildConfiguration)'
maximumCpuCount: true
msbuildArchitecture: 'x64'
- task: DeleteFiles@1
inputs:
Contents: |
ARM64\install.tar.gz
x64\install.tar.gz
- task: CopyFiles@2
inputs:
SourceFolder: '$(appxPackageDir)'
Contents: '**\*bundle.msixupload'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: DeleteFiles@1
inputs:
SourceFolder: '$(appxPackageDir)'
Contents: |
**\*bundle.msixupload
**\*.msixbundle
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
- task: store-flight@0
continueOnError: true
timeoutInMinutes: 10
inputs:
serviceEndpoint: 'Whitewater Foundry'
appId: '9NV1GV1PXZ6P'
flightName: 'Azure Pipelines'
packagePath: '$(Build.ArtifactStagingDirectory)\**\*bundle.msixupload'
force: true
skipPolling: false
deletePackages: true
numberOfPackagesToKeep: '2'
- task: store-publish@0
continueOnError: true
timeoutInMinutes: 10
inputs:
serviceEndpoint: 'Whitewater Foundry'
appId: '9NV1GV1PXZ6P'
metadataUpdateMethod: 'TextMetadata'
metadataPath: '$(System.DefaultWorkingDirectory)\appMetadata'
updateImages: true
packagePath: '$(Build.ArtifactStagingDirectory)\**\*bundle.msixupload'
force: true
skipPolling: false
deletePackages: true
numberOfPackagesToKeep: '2'