-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #463 from TimeWarpEngineering/Cramer/2024-08-04/Ac…
…tionSetMethodSourceGen Fix Script
- Loading branch information
Showing
3 changed files
with
160 additions
and
159 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,93 +1,93 @@ | ||
name: Build and Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
env: | ||
DOTNET_NOLOGO: true # Disable the .NET logo in the console output | ||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable the .NET first time experience to skip caching NuGet packages and speed up the build | ||
DOTNET_CLI_TELEMETRY_OPTOUT: true | ||
NUGET_AUTH_TOKEN: ${{secrets.PUBLISH_TO_NUGET_ORG}} # <-- This is the token for the GitHub account you want to use. | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: pwsh | ||
steps: | ||
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." | ||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" | ||
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." | ||
|
||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." | ||
|
||
- name: Run BuildNuGets.ps1 | ||
run: | | ||
.\BuildNuGets.ps1 | ||
- name: Publish TimeWarp.State | ||
run: | | ||
cd Source/TimeWarp.State/bin/Release | ||
dotnet nuget push TimeWarp.State.*.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{secrets.PUBLISH_TO_NUGET_ORG}} | ||
# Assuming snupkg files are in the same directory and are named correspondingly | ||
- name: Publish TimeWarp.State.Plus | ||
run: | | ||
cd Source/TimeWarp.State.Plus/bin/Release | ||
dotnet nuget push TimeWarp.State.Plus.*.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{secrets.PUBLISH_TO_NUGET_ORG}} | ||
# Assuming snupkg files are in the same directory and are named correspondingly | ||
- name: Publish TimeWarp.State.Policies | ||
run: | | ||
cd Source/TimeWarp.State.Policies/bin/Release | ||
dotnet nuget push TimeWarp.State.Policies.*.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{secrets.PUBLISH_TO_NUGET_ORG}} | ||
# Assuming snupkg files are in the same directory and are named correspondingly | ||
- name: Extract version from Directory.Build.props | ||
id: extract_version | ||
run: | | ||
[xml]$xml = Get-Content -Path "Directory.Build.props" | ||
$version = $xml.Project.PropertyGroup.TimeWarpStateVersion | ||
echo "Extracted version: $version" | ||
echo "::set-output name=VERSION::$version" | ||
shell: pwsh | ||
|
||
- name: Tag commit with version | ||
run: | | ||
git config --local user.email "action@github.com" | ||
git config --local user.name "GitHub Action" | ||
$version = "${{ steps.extract_version.outputs.VERSION }}" -replace "\+.*$","" | ||
git tag -a $version -m "Release $version" | ||
git push origin $version | ||
shell: pwsh | ||
|
||
- name: Check if version is not a beta | ||
id: check_beta | ||
run: | | ||
$version = "${{ steps.extract_version.outputs.VERSION }}" | ||
$isBeta = $version -match "-beta" | ||
echo "IsBeta=$isBeta" | ||
# Setting output that indicates whether it's a beta version | ||
echo "::set-output name=IS_BETA::$isBeta" | ||
shell: pwsh | ||
|
||
- name: Create GitHub Release | ||
if: steps.check_beta.outputs.IS_BETA == 'False' | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.extract_version.outputs.VERSION }} | ||
release_name: Release ${{ steps.extract_version.outputs.VERSION }} | ||
draft: false | ||
prerelease: false | ||
body: "Description of the release goes here." | ||
|
||
|
||
- run: echo "🍏 This job's status is ${{ job.status }}." | ||
name: Build and Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
env: | ||
DOTNET_NOLOGO: true # Disable the .NET logo in the console output | ||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable the .NET first time experience to skip caching NuGet packages and speed up the build | ||
DOTNET_CLI_TELEMETRY_OPTOUT: true | ||
NUGET_AUTH_TOKEN: ${{secrets.PUBLISH_TO_NUGET_ORG}} # <-- This is the token for the GitHub account you want to use. | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: pwsh | ||
steps: | ||
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." | ||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" | ||
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." | ||
|
||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." | ||
|
||
- name: Run BuildNuGets.ps1 | ||
run: | | ||
.\BuildNuGets.ps1 | ||
- name: Publish TimeWarp.State | ||
run: | | ||
cd Source/TimeWarp.State/bin/Release | ||
dotnet nuget push TimeWarp.State.*.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{secrets.PUBLISH_TO_NUGET_ORG}} | ||
# Assuming snupkg files are in the same directory and are named correspondingly | ||
- name: Publish TimeWarp.State.Plus | ||
run: | | ||
cd Source/TimeWarp.State.Plus/bin/Release | ||
dotnet nuget push TimeWarp.State.Plus.*.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{secrets.PUBLISH_TO_NUGET_ORG}} | ||
# Assuming snupkg files are in the same directory and are named correspondingly | ||
- name: Publish TimeWarp.State.Policies | ||
run: | | ||
cd Source/TimeWarp.State.Policies/bin/Release | ||
dotnet nuget push TimeWarp.State.Policies.*.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{secrets.PUBLISH_TO_NUGET_ORG}} | ||
# Assuming snupkg files are in the same directory and are named correspondingly | ||
- name: Extract version from Directory.Build.props | ||
id: extract_version | ||
run: | | ||
[xml]$xml = Get-Content -Path "Directory.Build.props" | ||
$version = $xml.Project.PropertyGroup.TimeWarpStateVersion | ||
echo "Extracted version: $version" | ||
echo "::set-output name=VERSION::$version" | ||
shell: pwsh | ||
|
||
- name: Tag commit with version | ||
run: | | ||
git config --local user.email "action@github.com" | ||
git config --local user.name "GitHub Action" | ||
$version = "${{ steps.extract_version.outputs.VERSION }}" -replace "\+.*$","" | ||
git tag -a $version -m "Release $version" | ||
git push origin $version | ||
shell: pwsh | ||
|
||
- name: Check if version is not a beta | ||
id: check_beta | ||
run: | | ||
$version = "${{ steps.extract_version.outputs.VERSION }}" | ||
$isBeta = $version -match "-beta" | ||
echo "IsBeta=$isBeta" | ||
# Setting output that indicates whether it's a beta version | ||
echo "::set-output name=IS_BETA::$isBeta" | ||
shell: pwsh | ||
|
||
- name: Create GitHub Release | ||
if: steps.check_beta.outputs.IS_BETA == 'False' | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.extract_version.outputs.VERSION }} | ||
release_name: Release ${{ steps.extract_version.outputs.VERSION }} | ||
draft: false | ||
prerelease: false | ||
body: "Update Release notes on GitHub" | ||
|
||
|
||
- run: echo "🍏 This job's status is ${{ job.status }}." |
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 |
---|---|---|
@@ -1,65 +1,65 @@ | ||
<Project> | ||
<!-- Set common properties regarding assembly information and nuget packages --> | ||
<PropertyGroup> | ||
<TimeWarpStateVersion>11.0.0-beta.78+8.0.303</TimeWarpStateVersion> | ||
<Authors>Steven T. Cramer</Authors> | ||
<Product>TimeWarp State</Product> | ||
<PackageVersion>$(TimeWarpStateVersion)</PackageVersion> | ||
<PackageProjectUrl>https://timewarpengineering.github.io/timewarp-state/</PackageProjectUrl> | ||
<PackageTags>TimeWarp.State; TimeWarp-State; TimeWarpState; BlazorState; Blazor; State; Blazor-State; MediatR; Mediator; Pipeline; Redux; Flux</PackageTags> | ||
<PackageIcon>Logo.png</PackageIcon> | ||
<RepositoryUrl>https://github.com/TimeWarpEngineering/timewarp-state.git</RepositoryUrl> | ||
<RepositoryType>git</RepositoryType> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<PackageLicenseExpression>Unlicense</PackageLicenseExpression> | ||
<PackageReleaseNotes>https://timewarpengineering.github.io/timewarp-state/Overview.html</PackageReleaseNotes> | ||
<PackageReadmeFile>README.md</PackageReadmeFile> | ||
<ContentTargetFolders>contentFiles</ContentTargetFolders> | ||
</PropertyGroup> | ||
|
||
<!-- Deterministic Builds https://devblogs.microsoft.com/dotnet/producing-packages-with-source-link/#deterministic-builds --> | ||
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'"> | ||
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'"> | ||
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild> | ||
</PropertyGroup> | ||
|
||
<!-- Common compile parameters --> | ||
<PropertyGroup> | ||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<LangVersion>latest</LangVersion> | ||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> | ||
<NoWarn>CS7035;NU1503;1503</NoWarn> | ||
<Nullable>disable</Nullable> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> | ||
</PropertyGroup> | ||
|
||
<!--This is to add the CommitDate and CommitHash to your assemblyinfo --> | ||
|
||
<Target Name="SetAssemblyMetaData" BeforeTargets="PreBuildEvent" Condition="'$(NCrunch)' != '1'"> | ||
<Exec Command="git log -1 --format=%%ct" ConsoleToMSBuild="true" Condition="'$(OS)' == 'Windows_NT'"> | ||
<Output TaskParameter="ConsoleOutput" PropertyName="GitCommitTimestamp"/> | ||
</Exec> | ||
<Exec Command="git log -1 --format=%ct" ConsoleToMSBuild="true" Condition="'$(OS)' != 'Windows_NT'"> | ||
<Output TaskParameter="ConsoleOutput" PropertyName="GitCommitTimestamp"/> | ||
</Exec> | ||
<Exec Command="pwsh -ExecutionPolicy Bypass -NoProfile -File "$(MSBuildThisFileDirectory)ConvertTimestamp.ps1" -GitCommitTimestamp $(GitCommitTimestamp)" ConsoleToMSBuild="true"> | ||
<Output TaskParameter="ConsoleOutput" PropertyName="CommitDate"/> | ||
</Exec> | ||
<PropertyGroup> | ||
<!-- In Visual Studio the below line crashes if they fix VS then we can use this and no need for the powershell script --> | ||
<!--<LastCommitDate>$([System.DateTime]::UnixEpoch.AddSeconds($(GitCommitTimestamp)).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssK"))</LastCommitDate>--> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute"> | ||
<_Parameter1>CommitDate</_Parameter1> | ||
<_Parameter2>$(LastCommitDate)</_Parameter2> | ||
</AssemblyAttribute> | ||
</ItemGroup> | ||
<!-- <Message Importance="high" Text="OS: $(OS)" />--> | ||
<!-- <Message Importance="high" Text="CommitDate: $(LastCommitDate)" />--> | ||
</Target> | ||
</Project> | ||
<Project> | ||
<!-- Set common properties regarding assembly information and nuget packages --> | ||
<PropertyGroup> | ||
<TimeWarpStateVersion>11.0.0-beta.79+8.0.303</TimeWarpStateVersion> | ||
<Authors>Steven T. Cramer</Authors> | ||
<Product>TimeWarp State</Product> | ||
<PackageVersion>$(TimeWarpStateVersion)</PackageVersion> | ||
<PackageProjectUrl>https://timewarpengineering.github.io/timewarp-state/</PackageProjectUrl> | ||
<PackageTags>TimeWarp.State; TimeWarp-State; TimeWarpState; BlazorState; Blazor; State; Blazor-State; MediatR; Mediator; Pipeline; Redux; Flux</PackageTags> | ||
<PackageIcon>Logo.png</PackageIcon> | ||
<RepositoryUrl>https://github.com/TimeWarpEngineering/timewarp-state.git</RepositoryUrl> | ||
<RepositoryType>git</RepositoryType> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<PackageLicenseExpression>Unlicense</PackageLicenseExpression> | ||
<PackageReleaseNotes>https://timewarpengineering.github.io/timewarp-state/Overview.html</PackageReleaseNotes> | ||
<PackageReadmeFile>README.md</PackageReadmeFile> | ||
<ContentTargetFolders>contentFiles</ContentTargetFolders> | ||
</PropertyGroup> | ||
|
||
<!-- Deterministic Builds https://devblogs.microsoft.com/dotnet/producing-packages-with-source-link/#deterministic-builds --> | ||
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'"> | ||
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'"> | ||
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild> | ||
</PropertyGroup> | ||
|
||
<!-- Common compile parameters --> | ||
<PropertyGroup> | ||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<LangVersion>latest</LangVersion> | ||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> | ||
<NoWarn>CS7035;NU1503;1503</NoWarn> | ||
<Nullable>disable</Nullable> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> | ||
</PropertyGroup> | ||
|
||
<!--This is to add the CommitDate and CommitHash to your assemblyinfo --> | ||
|
||
<Target Name="SetAssemblyMetaData" BeforeTargets="PreBuildEvent" Condition="'$(NCrunch)' != '1'"> | ||
<Exec Command="git log -1 --format=%%ct" ConsoleToMSBuild="true" Condition="'$(OS)' == 'Windows_NT'"> | ||
<Output TaskParameter="ConsoleOutput" PropertyName="GitCommitTimestamp"/> | ||
</Exec> | ||
<Exec Command="git log -1 --format=%ct" ConsoleToMSBuild="true" Condition="'$(OS)' != 'Windows_NT'"> | ||
<Output TaskParameter="ConsoleOutput" PropertyName="GitCommitTimestamp"/> | ||
</Exec> | ||
<Exec Command="pwsh -ExecutionPolicy Bypass -NoProfile -File "$(MSBuildThisFileDirectory)ConvertTimestamp.ps1" -GitCommitTimestamp $(GitCommitTimestamp)" ConsoleToMSBuild="true"> | ||
<Output TaskParameter="ConsoleOutput" PropertyName="CommitDate"/> | ||
</Exec> | ||
<PropertyGroup> | ||
<!-- In Visual Studio the below line crashes if they fix VS then we can use this and no need for the powershell script --> | ||
<!--<LastCommitDate>$([System.DateTime]::UnixEpoch.AddSeconds($(GitCommitTimestamp)).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssK"))</LastCommitDate>--> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute"> | ||
<_Parameter1>CommitDate</_Parameter1> | ||
<_Parameter2>$(LastCommitDate)</_Parameter2> | ||
</AssemblyAttribute> | ||
</ItemGroup> | ||
<!-- <Message Importance="high" Text="OS: $(OS)" />--> | ||
<!-- <Message Importance="high" Text="CommitDate: $(LastCommitDate)" />--> | ||
</Target> | ||
</Project> |