Skip to content

Commit

Permalink
Merge branch 'release/1.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
vexx32 committed Feb 15, 2023
2 parents 1d99819 + d2db589 commit 1a425c8
Show file tree
Hide file tree
Showing 46 changed files with 911 additions and 399 deletions.
66 changes: 33 additions & 33 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ jobs:
ubuntu-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache Tools
uses: actions/cache@v2.1.6
uses: actions/cache@v3.0.11
with:
path: tools
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
- name: Build with Mono
run: |
chmod +x build.sh
$GITHUB_WORKSPACE//build.sh --verbosity=diagnostic --target=CI
$GITHUB_WORKSPACE//build.sh --verbosity=diagnostic --target=CI --testExecutionType=all
- name: Upload Ubuntu build results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
# Always upload build results
if: ${{ always() }}
with:
Expand All @@ -40,18 +40,18 @@ jobs:
windows-build:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache Tools
uses: actions/cache@v2.1.6
uses: actions/cache@v3.0.11
with:
path: tools
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
- name: Build with .Net Framework
run: ./build.ps1 --verbosity=diagnostic --target=CI
run: ./build.ps1 --verbosity=diagnostic --target=CI --testExecutionType=all --shouldRunOpenCover=false
- name: Upload Windows build results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
# Always upload build results
if: ${{ always() }}
with:
Expand All @@ -66,31 +66,31 @@ jobs:
code_drop\Packages\NuGet\*.nupkg
code_drop\Packages\Chocolatey\*.nupkg
code_drop\MsBuild.log
- uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: |
code_drop\TestCoverage\lcov.info
flag-name: run-${{ matrix.os }}
parallel: true
# - uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# path-to-lcov: |
# code_drop\TestCoverage\lcov.info
# flag-name: run-${{ matrix.os }}
# parallel: true
# Build using mono on MacOS
macos-build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache Tools
uses: actions/cache@v2.1.6
uses: actions/cache@v3.0.11
with:
path: tools
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
- name: Build with Mono
run: |
chmod +x build.sh
$GITHUB_WORKSPACE//build.sh --verbosity=diagnostic --target=CI
$GITHUB_WORKSPACE//build.sh --verbosity=diagnostic --target=CI --testExecutionType=all
- name: Upload MacOS build results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
# Always upload build results
if: ${{ always() }}
with:
Expand All @@ -105,20 +105,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache Tools
uses: actions/cache@v2.1.6
uses: actions/cache@v3.0.11
with:
path: tools
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile.linux
Expand All @@ -131,12 +131,12 @@ jobs:
"github_base_ref=${{ github.base_ref }}"
"github_head_ref=${{ github.head_ref }}"
"github_run_number=${{ github.run_number }}"
upload-code-coverage-results:
needs: [ubuntu-build, windows-build, macos-build]
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
#upload-code-coverage-results:
# needs: [ubuntu-build, windows-build, macos-build]
# runs-on: ubuntu-latest
# steps:
# - name: Coveralls Finished
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# parallel-finished: true
18 changes: 9 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
ubuntu-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache Tools
uses: actions/cache@v2.1.6
uses: actions/cache@v3.0.11
with:
path: tools
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
Expand All @@ -26,7 +26,7 @@ jobs:
chmod +x build.sh
$GITHUB_WORKSPACE//build.sh --verbosity=diagnostic --target=test --testExecutionType=all
- name: Upload Ubuntu build results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
# Always upload build results
if: ${{ always() }}
with:
Expand All @@ -39,18 +39,18 @@ jobs:
windows-build:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache Tools
uses: actions/cache@v2.1.6
uses: actions/cache@v3.0.11
with:
path: tools
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
- name: Test with NUnit on .Net Framework
run: .\build.bat --verbosity=diagnostic --target=test --testExecutionType=all --shouldRunOpenCover=false
- name: Upload Windows build results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
# Always upload build results
if: ${{ always() }}
with:
Expand All @@ -65,11 +65,11 @@ jobs:
macos-build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache Tools
uses: actions/cache@v2.1.6
uses: actions/cache@v3.0.11
with:
path: tools
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
Expand All @@ -78,7 +78,7 @@ jobs:
chmod +x build.sh
$GITHUB_WORKSPACE//build.sh --verbosity=diagnostic --target=test --testExecutionType=all
- name: Upload MacOS build results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
# Always upload build results
if: ${{ always() }}
with:
Expand Down
2 changes: 1 addition & 1 deletion .teamcity/settings.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ object Chocolatey : BuildType({

script {
name = "Call Cake"
scriptContent = "call build.official.bat --verbosity=diagnostic --target=CI"
scriptContent = "call build.official.bat --verbosity=diagnostic --target=CI --testExecutionType=all --shouldRunOpenCover=false"
}
}

Expand Down
29 changes: 21 additions & 8 deletions GenerateDocs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ RedirectFrom:
In your Chocolatey packaging, you have the ability to use these functions (and others with Chocolatey's [PowerShell Extensions](xref:extensions)) to work with all aspects of software management. Keep in mind Chocolatey's automation scripts are just PowerShell, so you can do manage anything you want.
> :memo: **NOTE** These scripts are for package scripts, not for use directly in PowerShell. This is in the create packages section, not the using Chocolatey section.
> :choco-info: **NOTE**
>
> These scripts are for package scripts, not for use directly in PowerShell. This is in the create packages section, not the using Chocolatey section.
## Main Functions
Expand Down Expand Up @@ -121,7 +123,9 @@ function Replace-CommonItems($text) {
if ($text -eq $null) {return $text}

$text = $text.Replace("`n",$lineFeed)
$text = $text -replace "\*\*NOTE:\*\*", "> :memo: **NOTE**"
$text = $text -replace "\*\*NOTE:\*\*", '> :choco-info: **NOTE**
>
>'
$text = $text -replace '(community feed[s]?[^\]]|community repository)', '[$1](https://community.chocolatey.org/packages)'
$text = $text -replace '(Chocolatey for Business|Chocolatey Professional|Chocolatey Pro)(?=[^\w])', '[$1](https://chocolatey.org/compare)'
$text = $text -replace '(Pro[fessional]\s?/\s?Business)', '[$1](https://chocolatey.org/compare)'
Expand Down Expand Up @@ -211,8 +215,8 @@ param(
$commandText = $commandText -creplace '^(DEPRECATION NOTICE|Usage|Troubleshooting|Examples|Exit Codes|Connecting to Chocolatey.org|See It In Action|Alternative Sources|Resources|Packages.config|Scripting \/ Integration - Best Practices \/ Style Guide)', '## $1'
$commandText = $commandText -replace '^(Commands|How To Pass Options)', '## $1'
$commandText = $commandText -replace '^(WebPI|Windows Features|Ruby|Cygwin|Python)\s*$', '### $1'
$commandText = $commandText -replace 'NOTE\:', '> :memo: **NOTE**'
$commandText = $commandText -replace '\*> :memo: \*\*NOTE\*\*\*', '> :memo: **NOTE**'
$commandText = $commandText -replace '(?<!\s)NOTE:', '> :choco-info: **NOTE**'
$commandText = $commandText -replace '\*> :choco-info: \*\*NOTE\*\*\*', '> :choco-info: **NOTE**'
$commandText = $commandText -replace 'the command reference', '[how to pass arguments](xref:choco-commands#how-to-pass-options-switches)'
$commandText = $commandText -replace '(community feed[s]?|community repository)', '[$1](https://community.chocolatey.org/packages)'
#$commandText = $commandText -replace '\`(apikey|install|upgrade|uninstall|list|search|info|outdated|pin)\`', '[[`$1`|Commands$1]]'
Expand All @@ -238,11 +242,16 @@ param(
$commandText = $commandText -replace 'https://chocolatey.org/docs/features-package-reducer', 'https://docs.chocolatey.org/en-us/features/package-reducer'
$commandText = $commandText -replace 'https://chocolatey.org/docs/en-us/features/package-reducer', 'https://docs.chocolatey.org/en-us/features/package-reducer'
$commandText = $commandText -replace '\[community feed\)\]\(https://community.chocolatey.org/packages\)', '[community feed](https://community.chocolatey.org/packages))'
$commandText = $commandText -replace '> :choco-info: \*\*NOTE\*\*\s', '> :choco-info: **NOTE**
>
> '

$optionsSwitches = @'
## $1
> :memo: **NOTE** Options and switches apply to all items passed, so if you are
> :choco-info: **NOTE**
>
> Options and switches apply to all items passed, so if you are
running a command like install that allows installing multiple
packages, and you use `--version=1.0.0`, it is going to look for and
try to install version 1.0.0 of every package passed. So please split
Expand All @@ -258,7 +267,9 @@ Includes [default options/switches](xref:choco-commands#default-options-and-swit
$optionsSwitches = @'
## $1
> :memo: **NOTE** Options and switches apply to all items passed, so if you are
> :choco-info: **NOTE**
>
> Options and switches apply to all items passed, so if you are
running a command like install that allows installing multiple
packages, and you use `--version=1.0.0`, it is going to look for and
try to install version 1.0.0 of every package passed. So please split
Expand Down Expand Up @@ -359,7 +370,7 @@ function Generate-CommandReference($commandName, $order) {
$commandOutput += @("<!-- This file is automatically generated based on output from $($sourceCommands)/Chocolatey$($commandName)Command.cs using $($sourceLocation)GenerateDocs.ps1. Contributions are welcome at the original location(s). If the file is not found, it is not part of the open source edition of Chocolatey or the name of the file is different. --> $lineFeed")

$commandOutput += @(@"
> :memo: **WARNING** SHIM DEPRECATION
> :choco-warning: **WARNING** SHIM DEPRECATION
>
> With the release of Chocolatey CLI v1.0.0 we have deprecated the following shims/shortcuts:
>
Expand Down Expand Up @@ -457,7 +468,9 @@ $( if ($_.relatedLinks -ne $null) {Write-Output "$lineFeed## Links$lineFeed$line
[Function Reference](xref:powershell-reference)
> :memo: **NOTE** This documentation has been automatically generated from ``Import-Module `"`$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1`" -Force; Get-Help $($_.Name) -Full``.
> :choco-info: **NOTE**
>
> This documentation has been automatically generated from ``Import-Module `"`$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1`" -Force; Get-Help $($_.Name) -Full``.
View the source for [$($_.Name)]($sourceFunctions/$($_.Name)`.ps1)
"@ | Out-File $fileName -Encoding UTF8 -Force
Expand Down
14 changes: 14 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
branches:
support:
mode: ContinuousDeployment
tag: alpha
increment: Minor
prevent-increment-of-merged-branch-version: false
track-merge-target: true
regex: ^support[/-]
source-branches:
- main
tracks-release-branches: true
is-release-branch: false
is-mainline: false
pre-release-weight: 55000
13 changes: 13 additions & 0 deletions Invoke-Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ param(
)
$packageRegex = 'chocolatey\.\d.*\.nupkg'

# Check if there are any tests that exceed Test Kitchen maximum lengths
$TestsLocation = Join-Path $PSScriptRoot tests
$MaxFileNameLength = 110
$LongFiles = Get-ChildItem $TestsLocation -Recurse |
Where-Object { ($_.FullName.Length - $TestsLocation.Length) -gt $MaxFileNameLength } |
Select-Object -Property @{Name = 'RelativePath' ; Expression = { $_.FullName.Replace($TestsLocation, [string]::Empty)}}, @{ Name = 'ReductionNeeded' ; Expression = { $_.FullName.Length - $TestsLocation.Length - $MaxFileNameLength } }

if ($LongFiles) {
Write-Host "Tests' file paths may be too long for Test Kitchen use. Please shorten file names or paths:"
$LongFiles | Format-List | Out-String | Out-Host
throw "Unable to complete tests due to long file paths"
}

# Use TstPkg as TestPackage has ValidateScript that can't be circumvented
if (-not $TestPackage) {
$TstPkg = Get-ChildItem $PSScriptRoot/code_drop/Packages/Chocolatey -Filter *.nupkg | Where-Object Name -Match $packageRegex
Expand Down
Loading

0 comments on commit 1a425c8

Please sign in to comment.