-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd3b711
commit eac631d
Showing
5 changed files
with
69 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,25 @@ | ||
name: "create github release" | ||
name: "2. create github release" | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
tagged-release: | ||
name: "Tagged Release" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: "Get Version info from src/Directory.Build.props" | ||
id: "get_version" | ||
shell: pwsh | ||
run: | | ||
$version_info = & ./scripts/get_build_version.ps1 | ||
echo "version: $version_info" | ||
Write-Output "::set-output name=version_str::$('v'+$($version_info.OriginalVersion))" | ||
# Create GitHub.com Release | ||
- name: "Create GitHub Release" | ||
uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
automatic_release_tag: "${{ steps.get_version.outputs.version_str }}" | ||
prerelease: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env pwsh | ||
Set-StrictMode -Version 3 | ||
Set-Variable -Name build_version_text -Value ` | ||
(Select-Xml -Path './src/Directory.Build.props' -XPath "/Project/PropertyGroup/Version[contains(@Condition, `"`'`$(Version)`'==`'`'`")]//text()[1]").Node.Value -Option Constant; | ||
Set-Variable -Name package_name -Value 'Nuget.Versioning' -Option Constant; | ||
Set-Variable -Name package_version -Value '6.3.0' -Option Constant; | ||
Set-Variable -Name type_name -Value 'NuGet.Versioning.NuGetVersion' -Option Constant; | ||
Set-Variable -Name nuget_source -Value 'https://api.nuget.org/v3/index.json' -Option Constant; | ||
|
||
if ($type_name -as [type]) | ||
{ | ||
Write-Debug "{$type_name} already loaded"; | ||
$ret = New-Object -TypeName $type_name -ArgumentList "$build_version_text"; | ||
return $ret; | ||
} | ||
$package = get-package -ProviderName Nuget | Where-Object { $_.Name -eq $package_name }; | ||
if ($null -eq $package) | ||
{ | ||
Write-Debug "Package $package_name not found"; | ||
# Get nuget package and find the extraced dll in first occurence | ||
Write-Debug "try to download `"$package_name`" nuget package..." | ||
$error.Clear(); | ||
(Install-Package -Verbose -Name "$package_name" -RequiredVersion $package_version -SkipDependencies -ProviderName NuGet -Source $nuget_source -Scope CurrentUser -Force) | Out-Null; | ||
$package = Get-Package $package_name; | ||
} | ||
|
||
$nuget_versioning_source = $package.Source; | ||
if ($null -eq $nuget_versioning_source) | ||
{ | ||
Write-Debug "get package `"$package_name`" again"; | ||
$nuget_versioning_source = (Get-Package $package_name).Source; | ||
} | ||
$nuget_dll_path = ` | ||
(Get-ChildItem -File -Filter "$package_name.dll" -Recurse (Split-Path $nuget_versioning_source) | Where-Object { $_.Directory -like '*netstandard2.0*' }).FullName; | ||
|
||
Write-Debug "`"$package_name.dll`" real path: $nuget_dll_path" | ||
|
||
$execute_job = Start-Job -ScriptBlock { | ||
(Add-Type -Path $args[0]) | Out-Null; | ||
$ret = New-Object -TypeName $args[1] -ArgumentList $args[2]; | ||
return $ret; | ||
} -ArgumentList $nuget_dll_path, $type_name, $build_version_text; | ||
|
||
(Wait-Job $execute_job) | Out-Null; | ||
$job_result = Receive-Job $execute_job -Keep; | ||
$ret = $job_result | Where-Object { $_.RunspaceId -ne $null } | Select-Object * -ExcludeProperty PSComputerName, PSShowComputerName, RunspaceId; | ||
|
||
return $ret; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters