Skip to content

⬆️ Updates Dependencies & Version Calculation #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
30 changes: 15 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ jobs:
steps:
- run: echo "Beginning release."
- name: "Transfer 'version-json' artifact from triggering workflow"
uses: pwshrc/actions-transfer-artifact@v0.4.0
uses: pwshrc/actions-transfer-artifact@v0.5.0
with:
name: 'version-json'
- name: "Transfer 'PSGallery-package' artifact from triggering workflow"
uses: pwshrc/actions-transfer-artifact@v0.4.0
uses: pwshrc/actions-transfer-artifact@v0.5.0
with:
name: 'PSGallery-package'
- name: "Transfer 'release-notes' artifact from triggering workflow"
uses: pwshrc/actions-transfer-artifact@v0.4.0
uses: pwshrc/actions-transfer-artifact@v0.5.0
with:
name: 'release-notes'

Expand All @@ -36,22 +36,22 @@ jobs:
uses: actions/checkout@v4
- name: Populate GitVersion variables
id: gitversion_vars
uses: pwshrc/actions-determine-version@v0.8.7
uses: pwshrc/actions-determine-version@v0.9.0
with:
mode: 'download'
- name: "Get artifact: PSGallery-package"
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: PSGallery-package
path: ./out/
- name: Publish Prerelease to PSGallery (WhatIf)
if: steps.gitversion_vars.outputs.PreReleaseTag != ''
uses: pwshrc/actions-invoke-lib-dependent-pwsh@v0.2.10
uses: pwshrc/actions-invoke-lib-dependent-pwsh@v0.3.1
with:
run: ./build/publish.ps1 -NUGET_KEY "abc" -Prerelease -WhatIf
- name: Publish Release to PSGallery (WhatIf)
if: steps.gitversion_vars.outputs.PreReleaseTag == ''
uses: pwshrc/actions-invoke-lib-dependent-pwsh@v0.2.10
uses: pwshrc/actions-invoke-lib-dependent-pwsh@v0.3.1
with:
run: ./build/publish.ps1 -NUGET_KEY "abc" -WhatIf

Expand All @@ -64,24 +64,24 @@ jobs:
uses: actions/checkout@v4
- name: Populate GitVersion variables
id: gitversion_vars
uses: pwshrc/actions-determine-version@v0.8.7
uses: pwshrc/actions-determine-version@v0.9.0
with:
mode: 'download'
- name: "Get artifact: PSGallery-package"
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: PSGallery-package
path: ./out/
- name: Publish Prerelease to PSGallery
if: steps.gitversion_vars.outputs.PreReleaseTag != ''
uses: pwshrc/actions-invoke-lib-dependent-pwsh@v0.2.10
uses: pwshrc/actions-invoke-lib-dependent-pwsh@v0.3.1
env:
NUGET_KEY: ${{ secrets.NUGET_KEY }}
with:
run: ./build/publish.ps1 -NUGET_KEY "$env:NUGET_KEY" -Prerelease
- name: Publish Release to PSGallery
if: steps.gitversion_vars.outputs.PreReleaseTag == ''
uses: pwshrc/actions-invoke-lib-dependent-pwsh@v0.2.10
uses: pwshrc/actions-invoke-lib-dependent-pwsh@v0.3.1
env:
NUGET_KEY: ${{ secrets.NUGET_KEY }}
with:
Expand All @@ -96,23 +96,23 @@ jobs:
uses: actions/checkout@v4
- name: Get GitVersion
id: gitversion_vars
uses: pwshrc/actions-determine-version@v0.8.7
uses: pwshrc/actions-determine-version@v0.9.0
with:
mode: 'download'
- name: Get release notes
id: get-releasenotes
uses: pwshrc/actions-create-release-notes@v0.8.11
uses: pwshrc/actions-create-release-notes@v0.9.4
with:
mode: 'download'
github_token: "${{ secrets.GITHUB_TOKEN }}"
- name: "Get artifact: PSGallery-package"
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: PSGallery-package
path: ./out/
- name: Publish GitHub release
id: publish_github_release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # v2.1.0
with:
token: "${{ secrets.RELEASE_GITHUB_TOKEN }}"
name: "v${{ steps.gitversion_vars.outputs.SemVer }}"
Expand Down
25 changes: 13 additions & 12 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Check out repository code
uses: actions/checkout@v4
- name: Lint with PSScriptAnalyzer
uses: pwshrc/actions-invoke-lib-dependent-pwsh@v0.2.10
uses: pwshrc/actions-invoke-lib-dependent-pwsh@v0.3.1
with:
run: ./build/lint.ps1 -CI -NoFail:([bool]"${{ secrets.MANDATE_LINT_SUCCESS != 'true' }}")

Expand All @@ -24,7 +24,7 @@ jobs:
steps:
- name: Populate GitVersion variables
id: gitversion_vars
uses: pwshrc/actions-determine-version@v0.8.7
uses: pwshrc/actions-determine-version@v0.9.0
with:
mode: 'upload'

Expand All @@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Create release notes
uses: pwshrc/actions-create-release-notes@v0.8.11
uses: pwshrc/actions-create-release-notes@v0.9.4
with:
mode: 'upload'
github_token: "${{ secrets.GITHUB_TOKEN }}"
Expand All @@ -48,17 +48,17 @@ jobs:
uses: actions/checkout@v4
- name: Populate GitVersion
id: gitversion_vars
uses: pwshrc/actions-determine-version@v0.8.7
uses: pwshrc/actions-determine-version@v0.9.0
with:
mode: 'download'
- name: Populate release notes
id: get-releasenotes
uses: pwshrc/actions-create-release-notes@v0.8.11
uses: pwshrc/actions-create-release-notes@v0.9.4
with:
mode: 'download'
github_token: "${{ secrets.GITHUB_TOKEN }}"
- name: Build PSGallery package
uses: pwshrc/actions-invoke-lib-dependent-pwsh@v0.2.10
uses: pwshrc/actions-invoke-lib-dependent-pwsh@v0.3.1
env:
PackageVersion: ${{ steps.gitversion_vars.outputs.NuGetVersionV2 }}
ModuleVersionMajor: ${{ steps.gitversion_vars.outputs.Major }}
Expand All @@ -73,7 +73,7 @@ jobs:
[Version] $moduleVersion = [Version]::new($Env:ModuleVersionMajor, $Env:ModuleVersionMinor, $Env:ModuleVersionPatch)
./build/package.ps1 -PackageVersion $Env:PackageVersion -ModuleVersion $moduleVersion -PackageVersionPrereleaseTag $Env:PackageVersionPrereleaseTag -ReleaseNotes $releaseNotes -CommitSha $Env:CommitSha
- name: "Create artifact: PSGallery-package"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: PSGallery-package
path: ./out/*.nupkg
Expand Down Expand Up @@ -107,26 +107,27 @@ jobs:
- name: Check out repository code
uses: actions/checkout@v4
- name: "Get artifact: PSGallery-package"
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: PSGallery-package
path: ./out/
- name: Test with Pester
uses: pwshrc/actions-invoke-lib-dependent-pwsh@v0.2.10
uses: pwshrc/actions-invoke-lib-dependent-pwsh@v0.3.1
with:
run: ./build/test.ps1 -UsePackageExport -CI -OutputFilesPrefix "${{ matrix.os }}-" -NoFail:([bool]"${{ matrix.experimental }}")
- name: "Create artifact: tests-${{ matrix.os }}"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: "tests-${{ matrix.os }}"
path: ./out/*.xml
if-no-files-found: error
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5.1.1
if: github.ref == 'refs/heads/main'
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
flags: ${{ matrix.codecov_os }},unittests
directory: ./out
files: "*coverage.xml"
Expand Down
3 changes: 3 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ minor-version-bump-message: '(\+semver:\s?(feature|minor))|^\s*(✨|🏗|⚡|
patch-version-bump-message: '(\+semver:\s?(fix|patch))|^\s*(🩹|🚑|🔒|♻|💚|⬆|⬇|🔧|📝|🔥|👷‍♂️|🔨|⏪|🚚|🎨|🚀|💄|✅|🔐|🚨|🚧|📌|📈|🌐|✏️|💩|🔀|📦|👽|🍱|♿|💡|🍻|💬|🗨️|🗃️|🔊|🔉|🔈|🔇|👥|📱|🤡|🥚|🙈|📸|📷|⚗️|🔍|🔎|🌱|🚩|🥅|💫|🗑️|🛂|🧐|⚰️|🧑‍💻|👨‍💻|👩‍💻|💸)'
no-bump-message: '\+semver:\s?(none|skip)'
assembly-versioning-scheme: MajorMinorPatch
branches:
main:
mode: ContinuousDeployment
14 changes: 13 additions & 1 deletion build/package-dev.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,19 @@ elseif (Get-Command gitversion -ErrorAction SilentlyContinue) {
if ($gitversion_bin) {
[PSObject] $versionInfo = & $gitversion_bin | ConvertFrom-Json

[string] $PackageVersion = $versionInfo | Select-Object -ExpandProperty NuGetVersionV2
[string] $paddedNumberFormatPattern = "0000"
[string] $prereleaseLabelShortened = ($versionInfo.PreReleaseLabel.Length -gt 16) ? $versionInfo.PreReleaseLabel.Substring(0, 16) : $versionInfo.PreReleaseLabel
# TODO: Verify 'PreReleaseNumber' is correct suffix. Ambiguous from historical documentation found at https://github.com/GitTools/GitVersion/blob/v4.0.0/docs/more-info/variables.md.
[Nullable[int]] $preReleaseNumber = $versionInfo.PreReleaseNumber -as [int]
if ($preReleaseNumber -and $versionInfo.PreReleaseLabel) {
[string] $LegacySemVer = $versionInfo.MajorMinorPatch + "-" + $versionInfo.PreReleaseLabel + $preReleaseNumber
[string] $LegacySemVerPadded = $versionInfo.MajorMinorPatch + "-" + $prereleaseLabelShortened + $preReleaseNumber.ToString($paddedNumberFormatPattern)
} else {
[string] $LegacySemVer = $versionInfo.MajorMinorPatch
[string] $LegacySemVerPadded = $versionInfo.MajorMinorPatch
}
[string] $PackageVersion = $LegacySemVerPadded

[string] $PackageVersionPrereleaseTag = $versionInfo | Select-Object -ExpandProperty PreReleaseTag
[string] $assemblySemVer = $versionInfo | Select-Object -ExpandProperty AssemblySemVer
[string] $CommitSha = $versionInfo | Select-Object -ExpandProperty Sha
Expand Down
8 changes: 4 additions & 4 deletions packages.PSGallery.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="poshy-lucidity" version="0.3.16" />
<package id="Pester" version="5.5.0" developmentDependency="true" />
<package id="poshy-lucidity" version="0.4.1" />
<package id="Pester" version="5.6.1" developmentDependency="true" />
<package id="PowerShellGet" version="2.2.5" developmentDependency="true" />
<package id="PSScriptAnalyzer" version="1.21.0" developmentDependency="true" />
</packages>
<package id="PSScriptAnalyzer" version="1.23.0" developmentDependency="true" />
</packages>
9 changes: 9 additions & 0 deletions src/_python3.ps1 → src/poshy-wrap-python.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env pwsh
$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest
#Requires -Modules @{ ModuleName = "poshy-lucidity"; RequiredVersion = "0.4.1" }


function _python3() {
Expand All @@ -20,3 +21,11 @@ function pyserver {
Set-Alias -Name python3 -Value _python3
Set-Alias -Name py -Value _python3
Set-Alias -Name python -Value _python3


if ((Test-Command ipython3) -or (Get-Variable -Name PWSHRC_FORCE_MODULES_EXPORT_UNSUPPORTED -Scope Global -ValueOnly -ErrorAction SilentlyContinue)) {
Set-Alias -Name ipy -Value ipython3
Set-Alias -Name ipython -Value ipython3
}

Export-ModuleMember -Function * -Alias *
11 changes: 1 addition & 10 deletions src/poshy-wrap-python.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,4 @@ $ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest


Get-ChildItem -Path "$PSScriptRoot/*.ps1" | ForEach-Object {
. $_.FullName
}

if ((Test-Command ipython3) -or (Get-Variable -Name PWSHRC_FORCE_MODULES_EXPORT_UNSUPPORTED -Scope Global -ValueOnly -ErrorAction SilentlyContinue)) {
Set-Alias -Name ipy -Value ipython3
Set-Alias -Name ipython -Value ipython3
}

Export-ModuleMember -Function * -Alias *
. "$PSScriptRoot/poshy-wrap-python.ps1"
Loading