Skip to content
This repository was archived by the owner on Apr 30, 2024. It is now read-only.
Merged

Test #579

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
84a2880
Changed to explicit working directory
Avid29 Apr 21, 2022
9d83704
Moved QuarrelInstallerDirectory
Avid29 Apr 21, 2022
5ff9169
Changed working directory for QuarrelInstaller cloning
Avid29 Apr 21, 2022
8864405
Added name to git user config
Avid29 Apr 21, 2022
b564295
SSH Key in pipeline
Avid29 Apr 21, 2022
6be696f
Reverting to token login
Avid29 Apr 21, 2022
aeeef54
Update azure-pipelines-package-alpha.yml for Azure Pipelines
matthew4850 Apr 21, 2022
cd309cc
Update azure-pipelines-package-alpha.yml for Azure Pipelines
matthew4850 Apr 21, 2022
c07afa1
Update azure-pipelines-package-alpha.yml for Azure Pipelines
matthew4850 Apr 21, 2022
c3315f9
Update azure-pipelines-package-alpha.yml for Azure Pipelines
matthew4850 Apr 21, 2022
a3bf521
Update azure-pipelines-package-alpha.yml for Azure Pipelines
matthew4850 Apr 21, 2022
98e94fb
Update azure-pipelines-package-alpha.yml for Azure Pipelines
matthew4850 Apr 21, 2022
27bdf0a
Update azure-pipelines-package-alpha.yml for Azure Pipelines
matthew4850 Apr 21, 2022
2f55404
Update azure-pipelines-package-alpha.yml for Azure Pipelines
matthew4850 Apr 21, 2022
75cf9d4
Update azure-pipelines-package-alpha.yml for Azure Pipelines
matthew4850 Apr 21, 2022
011a930
Update azure-pipelines-package-alpha.yml for Azure Pipelines
matthew4850 Apr 21, 2022
c084835
Update azure-pipelines-package-alpha.yml for Azure Pipelines
matthew4850 Apr 21, 2022
bbd424d
Update azure-pipelines-package-alpha.yml for Azure Pipelines
matthew4850 Apr 21, 2022
35cc996
Update azure-pipelines-package-alpha.yml for Azure Pipelines
matthew4850 Apr 21, 2022
572c765
Update azure-pipelines-package-alpha.yml for Azure Pipelines
matthew4850 Apr 21, 2022
ea8b6ee
Update azure-pipelines-package-alpha.yml for Azure Pipelines
matthew4850 Apr 21, 2022
7f2ae10
Update azure-pipelines-package-alpha.yml for Azure Pipelines
matthew4850 Apr 21, 2022
0605523
Update azure-pipelines-package-alpha.yml for Azure Pipelines
matthew4850 Apr 21, 2022
c080594
Update azure-pipelines-package-alpha.yml for Azure Pipelines
matthew4850 Apr 21, 2022
f71a7ae
Increase alpha build times for testing
matthew4850 Apr 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
200 changes: 114 additions & 86 deletions azure-pipelines-package-alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
# Add steps that test and distribute an app, save build artifacts, and more:
# https://aka.ms/yaml

resources:
repositories:
- repository: QuarrelInstaller
type: github
endpoint: Connection
name: QuarrelForDiscord/QuarrelInstaller

trigger:
branches:
include:
Expand All @@ -17,104 +24,125 @@ variables:
solution: '**/Quarrel.App.sln'
buildPlatform: 'x86|x64|arm|arm64'
buildConfiguration: 'Alpha'
installerDirectory: '$(System.DefaultWorkingDirectory)\QuarrelInstaller'
installerDirectory: './QuarrelInstaller'
appxPackageDir: '$(build.artifactStagingDirectory)\AppxPackages\\'
buildDir: '$(build.artifactStagingDirectory)\build\\'
msixUploads: '$(appxPackageDir)\**\\*.msixupload'
msixBundles: '$(appxPackageDir)\**\\*.msixbundle'
msixPackages: '$(appxPackageDir)\**\\*.msix'
appInstaller: '$(appxPackageDir)\Quarrel.appinstaller'
appInstaller: '$(installerDirectory)\Quarrel.appinstaller'
siteUri: 'https://quarrelfordiscord.github.io/QuarrelInstaller/'

steps:
#- task: DownloadSecureFile@1
# displayName: Get Signing Certificate
# name: signingCertificate
# inputs:
# secureFile: 'Quarrel-Alpha_Key.pfx'
#- task: DownloadSecureFile@1
# displayName: Get AppCenterToken
# name: appCenterToken
# inputs:
# secureFile: 'AppCenterAlpha.json'

#- task: PowerShell@2
# displayName: Place AppCenterToken
# inputs:
# targetType: 'inline'
# script: 'Copy-Item $Env:APP_CENTER_TOKEN_PATH -Destination "$($Env:BUILD_SOURCESDIRECTORY)/src/Quarrel/Assets/Tokens/AppCenter/"'
# env:
# APP_CENTER_TOKEN_PATH: $(appCenterToken.secureFilePath)

#- task: NuGetToolInstaller@1
# displayName: 'NuGet Installer'

#- task: NuGetCommand@2
# displayName: 'NuGet Restore'
# inputs:
# restoreSolution: '$(solution)'

#- task: VSBuild@1
# displayName: 'Build'
# inputs:
# solution: '$(solution)'
# platform: 'x64'
# configuration: '$(buildConfiguration)'
# msbuildArgs: '/t:Quarrel
# /p:AppxBundlePlatforms="$(buildPlatform)"
# /p:AppxPackageDir="$(appxPackageDir)"
# /p:OutputPath="$(buildDir)"
# /p:AppxBundle=Always
# /p:AppxPackageSigningEnabled=true
# /p:PackageCertificateKeyFile="$(signingCertificate.secureFilePath)"
# /p:PackageCertificateThumbprint="$(SignedCertificateThumbprint-Alpha)"
# /p:PackageCertificatePassword="$(SignCertificatePassword-Alpha)"'

#- task: GitHubRelease@1
# displayName: 'Create GitHub release'
# inputs:
# gitHubConnection: 'Avid29'
# repositoryName: 'UWPCommunity/Quarrel'
# action: 'create'
# target: '$(Build.SourceVersion)'
# tag: "alpha-v$(Build.BuildNumber)"
# tagSource: 'userSpecifiedTag'
# title: 'Alpha-v$(Build.BuildNumber)'
# isPreRelease: true
# changeLogCompareToRelease: 'lastFullRelease'
# changeLogType: 'commitBased'
# assets: |
# $(msixUploads)
# $(msixBundles)
# $(msixPackages)
# $(appInstaller)
- checkout: self
- checkout: QuarrelInstaller
persistCredentials: true
- task: DownloadSecureFile@1
displayName: Get Signing Certificate
name: signingCertificate
inputs:
secureFile: 'Quarrel-Alpha_Key.pfx'

- script: |
md $(installerDirectory)
cd $(installerDirectory)
git config --global user.email $(GitHub-Email) & git config --global user.password $(GitHub-Token)
git clone https://github.com/QuarrelForDiscord/QuarrelInstaller.git
displayName: Clone QuarrelInstaller repo

#- task: CopyFiles@2
# displayName: Copy artifacts to QuarrelInstaller repo
# inputs:
# SourceFolder: '$(build.artifactStagingDirectory)'
# Contents: '**'
# TargetFolder: '$(System.DefaultWorkingDirectory)\QuarrelInstaller'
- task: DownloadSecureFile@1
displayName: Get AppCenterToken
name: appCenterToken
inputs:
secureFile: 'AppCenterAlpha.json'

- script: |
echo 'This is a test' > test.txt
displayName: Test add file
workingDirectory: $(installerDirectory)
- task: PowerShell@2
displayName: Place AppCenterToken
inputs:
targetType: 'inline'
script: 'Copy-Item $Env:APP_CENTER_TOKEN_PATH -Destination "$($Env:BUILD_SOURCESDIRECTORY)/src/Quarrel/Assets/Tokens/AppCenter/"'
env:
APP_CENTER_TOKEN_PATH: $(appCenterToken.secureFilePath)

- task: NuGetToolInstaller@1
displayName: 'NuGet Installer'

- task: NuGetCommand@2
displayName: 'NuGet Restore'
inputs:
restoreSolution: '$(solution)'

- task: VSBuild@1
displayName: 'Build'
inputs:
solution: '$(solution)'
platform: 'x64'
configuration: '$(buildConfiguration)'
msbuildArgs: '/t:Quarrel
/p:AppxBundlePlatforms="$(buildPlatform)"
/p:AppxPackageDir="$(appxPackageDir)"
/p:OutputPath="$(buildDir)"
/p:AppxBundle=Always
/p:AppxPackageSigningEnabled=true
/p:PackageCertificateKeyFile="$(signingCertificate.secureFilePath)"
/p:PackageCertificateThumbprint="$(SignedCertificateThumbprint-Alpha)"
/p:PackageCertificatePassword="$(SignCertificatePassword-Alpha)"
/p:AppInstallerUri="${siteUri}"
/p:AppInstallerUpdateFrequency=1
/p:AppInstallerCheckForUpdateFrequency=OnApplicationRun'

- powershell: |
[Reflection.Assembly]::LoadWithPartialName("System.Xml.Linq")
$doc = [System.Xml.Linq.XDocument]::Load(
"$(appxPackageDir)/Quarrel.appinstaller")
$xName = "{http://schemas.microsoft.com/appx/appinstaller/2017/2}MainBundle"
$bundle = $doc.Root.Element($xName).Attribute("Uri").Value.Replace("${siteUri}", "");
Copy-Item $bundle -Destination ($(build.artifactStagingDirectory) + $bundle.Replace("/", "_"));
$doc.Root.Element($xName).Attribute("Uri").Value =
"https://github.com/UWPCommunity/Quarrel/releases/download/alpha-v$(Build.BuildNumber)/Quarrel.appinstaller" +
$bundle.Replace("/", "_");

$xName = "{http://schemas.microsoft.com/appx/appinstaller/2017/2}Dependencies"

foreach ($element in $doc.Root.Elements($xName)){
$dep = $element.Attribute("Uri").Value.Replace("${siteUri}", "");
Copy-Item $dep -Destination ($(build.artifactStagingDirectory) + $dep.Replace("/", "_"));
$element.Attribute("Uri").Value =
"https://github.com/UWPCommunity/Quarrel/releases/download/alpha-v$(Build.BuildNumber)/Quarrel.appinstaller" +
$dep.Replace("/", "_");
}
$doc.Save("$(appInstaller)")
displayName: 'Fix appinstaller'

- task: GitHubRelease@1
displayName: 'Create GitHub release'
inputs:
gitHubConnection: 'Avid29'
repositoryName: 'UWPCommunity/Quarrel'
action: 'create'
target: '$(Build.SourceVersion)'
tag: "alpha-v$(Build.BuildNumber)"
tagSource: 'userSpecifiedTag'
title: 'Alpha-v$(Build.BuildNumber)'
isPreRelease: true
changeLogCompareToRelease: 'lastFullRelease'
changeLogType: 'commitBased'
assets: |
'$(build.artifactStagingDirectory)/*'

- task: CopyFiles@2
displayName: Copy artifacts to QuarrelInstaller repo
inputs:
SourceFolder: '$(build.artifactStagingDirectory)'
Contents: '**'
TargetFolder: '$(installerDirectory)'

- script: |
git config --global user.email $(GitHub-Email)
git config --global user.name "Azure Pipelines"
git add *
git commit -m "Update to $(Build.BuildNumber)"
git push origin main
git remote -v

echo 'test'
git push origin HEAD:refs/heads/master
displayName: Push to QuarrelInstaller repo
workingDirectory: $(System.DefaultWorkingDirectory)\QuarrelInstaller
workingDirectory: $(installerDirectory)

#- task: PublishBuildArtifacts@1
# displayName: 'Publish Artifact: drop'
# inputs:
# PathtoPublish: '$(build.artifactStagingDirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: '$(build.artifactStagingDirectory)'
8 changes: 3 additions & 5 deletions src/Quarrel/Quarrel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
<GenerateTestArtifacts>true</GenerateTestArtifacts>
<AppxBundle>Always</AppxBundle>
<AppxBundlePlatforms>x86|x64|arm</AppxBundlePlatforms>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
<AppInstallerUri>https://github.com/QuarrelForDiscord/QuarrelInstaller/blob/main/Quarrel.appinstaller?raw=true</AppInstallerUri>
</PropertyGroup>
<PropertyGroup>
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
Expand All @@ -44,10 +42,10 @@
<DebugType>full</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Alpha'">
<Optimize>true</Optimize>
<Optimize>false</Optimize>
<DefineConstants>ALPHA</DefineConstants>
<DebugType>pdbonly</DebugType>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
<UseDotNetNativeToolchain>false</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Insider'">
<Optimize>true</Optimize>
Expand Down Expand Up @@ -625,4 +623,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>