diff --git a/.github/workflows/build-module.yml b/.github/workflows/build-module.yml new file mode 100644 index 00000000..2e44f474 --- /dev/null +++ b/.github/workflows/build-module.yml @@ -0,0 +1,33 @@ +name: Chocolatey-AU Builds + +on: + # Trigger on pushes and on pull requests + push: + pull_request: + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + # Build on Windows + windows-build: + runs-on: windows-2019 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Cache Tools + uses: actions/cache@v3.0.11 + with: + path: tools + key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }} + - name: Build Chocolatey-AU module + run: .\build.ps1 -Task CI -Verbose -ErrorAction Stop + - name: Upload Windows build results + uses: actions/upload-artifact@v3 + # Always upload build results + if: ${{ always() }} + with: + name: build-results + path: | + Output\** diff --git a/.teamcity/settings.kts b/.teamcity/settings.kts new file mode 100644 index 00000000..98c7e4ad --- /dev/null +++ b/.teamcity/settings.kts @@ -0,0 +1,73 @@ +import jetbrains.buildServer.configs.kotlin.v2019_2.* +import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.PullRequests +import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.pullRequests +import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.powerShell +import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs + +project { + buildType(ChocolateyAU) +} + +object ChocolateyAU : BuildType({ + id = AbsoluteId("ChocolateyAU") + name = "Build" + + artifactRules = """ + +:Output/** + """.trimIndent() + + params { + param("env.vcsroot.branch", "%vcsroot.branch%") + param("env.Git_Branch", "%teamcity.build.vcs.branch.ChocolateyAu_HttpsGithubComCorbobChocolateyAuRefsHeads32buildPipeline%") + param("teamcity.git.fetchAllHeads", "true") + password("env.GITHUB_PAT", "%system.GitHubPAT%", display = ParameterDisplay.HIDDEN, readOnly = true) + } + + vcs { + root(DslContext.settingsRoot) + + branchFilter = """ + +:* + """.trimIndent() + } + + steps { + step { + name = "Include Signing Keys" + type = "PrepareSigningEnvironment" + } + powerShell { + name = "Build Module" + formatStderrAsError = true + scriptMode = script { + content = """ + try { + & .\build.ps1 -Task CI -Verbose -ErrorAction Stop + } + catch { + ${'$'}_ | Out-String | Write-Host -ForegroundColor Red + exit 1 + } + """.trimIndent() + } + noProfile = false + param("jetbrains_powershell_script_file", "build.ps1") + } + } + + triggers { + vcs { + branchFilter = "" + } + } + + features { + pullRequests { + provider = github { + authType = token { + token = "%system.GitHubPAT%" + } + } + } + } +}) diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 90cea4f1..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,40 +0,0 @@ -version: '{build}' -image: WMF 5 - -environment: - mail_user: majkinetor@gmail.com - -install: -- ps: 'Get-CimInstance win32_operatingsystem -Property Caption, OSArchitecture, Version | fl Caption, OSArchitecture, Version' -- ps: $PSVersionTable -- ps: ./setup.ps1 - -build_script: -- ps: | - $version = ./build.ps1 - Update-AppveyorBuild -Version $version - -test_script: -- ps: | - $res = ./test.ps1 - - "Uploading test results" - $url = "https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)" - (New-Object 'System.Net.WebClient').UploadFile($url, (Resolve-Path _build/*/TestResults.xml)) - if ($res.FailedCount -gt 0) { throw "$($res.FailedCount) tests failed." } - -#on_finish: -#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) - -artifacts: -- path: _build\*\*.nupkg -- path: _build\*\*.7z -- path: _build\*\*.xml - -notifications: -- provider: Email - to: $(mail_user) - on_build_success: false - on_build_failure: true - on_build_status_changed: true -