Skip to content

Commit

Permalink
(build) Add Team City PowerShell Signing Build
Browse files Browse the repository at this point in the history
  • Loading branch information
corbob committed Jun 5, 2024
1 parent 6e40d93 commit b76978b
Showing 1 changed file with 68 additions and 10 deletions.
78 changes: 68 additions & 10 deletions .teamcity/settings.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ project {
buildType(ChocolateyGUI)
buildType(ChocolateyGUISchd)
buildType(ChocolateyGUIQA)
buildType(ChocolateyGUISign)
}

object ChocolateyGUI : BuildType({
Expand Down Expand Up @@ -52,11 +53,6 @@ object ChocolateyGUI : BuildType({
}
}

step {
name = "Include Signing Keys"
type = "PrepareSigningEnvironment"
}

script {
name = "Call Cake"
scriptContent = """
Expand Down Expand Up @@ -189,11 +185,6 @@ object ChocolateyGUIQA : BuildType({
}
}

step {
name = "Include Signing Keys"
type = "PrepareSigningEnvironment"
}

script {
name = "Call Cake"
scriptContent = """
Expand All @@ -217,3 +208,70 @@ object ChocolateyGUIQA : BuildType({
}
}
})

object ChocolateyGUISign : BuildType({
id = AbsoluteId("ChocolateyGUISign")
name = "Chocolatey GUI (Script Signing)"

artifactRules = """
""".trimIndent()

params {
param("env.vcsroot.branch", "%vcsroot.branch%")
param("env.Git_Branch", "%teamcity.build.vcs.branch.Chocolatey_ChocolateyVcsRoot%")
param("env.FORCE_OFFICIAL_AUTHENTICODE_SIGNATURE", "true")
param("teamcity.git.fetchAllHeads", "true")
password("env.GITHUB_PAT", "%system.GitHubPAT%", display = ParameterDisplay.HIDDEN, readOnly = true)
}

vcs {
root(DslContext.settingsRoot)

branchFilter = """
+:*
""".trimIndent()
}

steps {
powerShell {
name = "Prerequisites"
scriptMode = script {
content = """
# Install Chocolatey Requirements
if ((Get-WindowsFeature -Name NET-Framework-Features).InstallState -ne 'Installed') {
Install-WindowsFeature -Name NET-Framework-Features
}
choco install windows-sdk-7.1 netfx-4.0.3-devpack dotnet-6.0-runtime --confirm --no-progress
exit ${'$'}LastExitCode
""".trimIndent()
}
}

step {
name = "Include Signing Keys"
type = "PrepareSigningEnvironment"
}

script {
name = "Call Cake"
scriptContent = """
build.official.bat --verbosity=diagnostic --target=Sign-PowerShellScripts --exclusive
""".trimIndent()
}
}

triggers {
vcs {
triggerRules = """
+:nuspec/**/*.ps1
""".trimIndent()
branchFilter = "+:develop"
}
}

requirements {
doesNotExist("docker.server.version")
doesNotContain("teamcity.agent.name", "Docker")
}
})

0 comments on commit b76978b

Please sign in to comment.