Skip to content
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

Gh action testing #330

Merged
merged 20 commits into from
May 4, 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
40 changes: 32 additions & 8 deletions .github/workflows/main-release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Main Branch Release Build

on:
push:
branches: [ "main" ]
branches: [ "main", "gh-action-testing" ]

jobs:
build:
Expand All @@ -17,22 +17,21 @@ jobs:
with:
submodules: true
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore ./src/dymaptic.GeoBlazor.Core/dymaptic.GeoBlazor.Core.csproj
- name: Copy Assets
- name: Copy Assets and Generate JS
shell: pwsh
run: |
cd ./src/dymaptic.GeoBlazor.Core
npm install
npm run releaseBuild
./assetCopy.ps1
cd ../..
- name: Build Core
run: dotnet build ./src/dymaptic.GeoBlazor.Core/dymaptic.GeoBlazor.Core.csproj --no-restore /p:OptOutFromCoreEsBuild=false /p:GenerateDocs=false /p:UpdateTemplates=false -c Release
- name: Build Templates
run: dotnet build ./templates/dymaptic.GeoBlazor.Templates.csproj -c Release
- name: Install xmllint
shell: bash
run: |
Expand All @@ -42,17 +41,40 @@ jobs:
run: |
CORE_VERSION=$(xmllint --xpath "//PropertyGroup/CoreVersion/text()" ./Directory.Build.props)
echo "CORE_VERSION=$CORE_VERSION" >> $GITHUB_ENV
- name: Verify JS Files and Assets
shell: pwsh
continue-on-error: false
# Verify that the JS files are present in the output directory
run: |
$nugetPath = "./src/dymaptic.GeoBlazor.Core/bin/Release/dymaptic.GeoBlazor.Core.${{env.CORE_VERSION}}.nupkg"
$extractPath = "./src/dymaptic.GeoBlazor.Core/bin/Release/extract"
$jsFilePath = "staticwebassets/js/arcGisJsInterop.js"
Expand-Archive -Path $nugetPath -Force -DestinationPath $extractPath
$contents = Get-ChildItem -Path $extractPath -Recurse
$fileExists = $contents -match [regex]::Escape($jsFilePath)
if ($fileExists) {
Write-Output "JS file exists"
} else {
Write-Error "JS file does not exist"
Exit 1
}
- name: Build Templates
run: dotnet build ./templates/dymaptic.GeoBlazor.Templates.csproj -c Release
- name: Copy PR Release Notes
run: |
PR_DESCRIPTION=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/pulls?state=closed&sort=updated&direction=desc" | \
jq -r '.[0].body')
echo "PR_DESCRIPTION=$PR_DESCRIPTION" >> $GITHUB_ENV
DESC_PLUS_EOF="${PR_DESCRIPTION}EOF"
echo "PR_DESCRIPTION<<EOF" >> $GITHUB_ENV
echo "$DESC_PLUS_EOF" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create Release
if: github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v1
with:
body: ${{env.PR_DESCRIPTION}}
tag_name: "v${{env.PRO_VERSION}}"
body: "${{env.PR_DESCRIPTION}}"
tag_name: "v${{env.CORE_VERSION}}"
generate_release_notes: true
prerelease: true
files: |
Expand All @@ -68,6 +90,7 @@ jobs:
name: .templates-nuget
path: ./templates/bin/Release/dymaptic.GeoBlazor.Templates.*.nupkg
nuget-push:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: build
steps:
Expand All @@ -78,6 +101,7 @@ jobs:
- name: Publish Core to Nuget
run: dotnet nuget push ./dymaptic.GeoBlazor.Core.*.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate
templates-nuget-push:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: build
steps:
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<PropertyGroup>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<CoreVersion>3.0.2-beta-2</CoreVersion>
<CoreVersion>3.0.2-beta-3</CoreVersion>
</PropertyGroup>
</Project>
5 changes: 3 additions & 2 deletions src/dymaptic.GeoBlazor.Core/dymaptic.GeoBlazor.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@
</ItemGroup>

<ItemGroup>
<Folder Include="wwwroot\assets\" />
<Folder Include="Documentation\" />
<Folder Include="wwwroot/assets/" />
<Folder Include="wwwroot/js/" />
<Folder Include="Documentation/" />
</ItemGroup>

<Target Name="NPM Install" BeforeTargets="PreBuildEvent" Condition="$(TargetFrameworks.StartsWith($(TargetFramework))) AND '$(OptOutFromCoreEsBuild)' != 'true'">
Expand Down
12 changes: 6 additions & 6 deletions src/dymaptic.GeoBlazor.Core/updateTemplates.ps1
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
$CoreVersion = $args[0]

(Get-Content ..\..\templates\dymaptic.GeoBlazor.Templates.csproj) `
-replace '\<PackageVersion\>[\d\.]*', ('<PackageVersion>' + $CoreVersion) |
-replace '\<PackageVersion\>[\d\.\-\w]*', ('<PackageVersion>' + $CoreVersion) |
Set-Content ..\..\templates\dymaptic.GeoBlazor.Templates.csproj

(Get-Content ..\..\templates\content\dymaptic.GeoBlazor.Template.Maui\dymaptic.GeoBlazor.Template.Maui.csproj) `
-replace '\<PackageReference Include="dymaptic.GeoBlazor.Core" Version="[\d\.]*"', ('<PackageReference Include="dymaptic.GeoBlazor.Core" Version="' + $CoreVersion + '"') |
-replace '\<PackageReference Include="dymaptic.GeoBlazor.Core" Version="[\d\.\-\w]*"', ('<PackageReference Include="dymaptic.GeoBlazor.Core" Version="' + $CoreVersion + '"') |
Set-Content ..\..\templates\content\dymaptic.GeoBlazor.Template.Maui\dymaptic.GeoBlazor.Template.Maui.csproj

(Get-Content ..\..\templates\content\dymaptic.GeoBlazor.Template.Server\dymaptic.GeoBlazor.Template.Server.csproj) `
-replace '\<PackageReference Include="dymaptic.GeoBlazor.Core" Version="[\d\.]*"', ('<PackageReference Include="dymaptic.GeoBlazor.Core" Version="' + $CoreVersion + '"') |
-replace '\<PackageReference Include="dymaptic.GeoBlazor.Core" Version="[\d\.\-\w]*"', ('<PackageReference Include="dymaptic.GeoBlazor.Core" Version="' + $CoreVersion + '"') |
Set-Content ..\..\templates\content\dymaptic.GeoBlazor.Template.Server\dymaptic.GeoBlazor.Template.Server.csproj

(Get-Content ..\..\templates\content\dymaptic.GeoBlazor.Template.WebAssembly\dymaptic.GeoBlazor.Template.WebAssembly.csproj) `
-replace '\<PackageReference Include="dymaptic.GeoBlazor.Core" Version="[\d\.]*"', ('<PackageReference Include="dymaptic.GeoBlazor.Core" Version="' + $CoreVersion + '"') |
-replace '\<PackageReference Include="dymaptic.GeoBlazor.Core" Version="[\d\.\-\w]*"', ('<PackageReference Include="dymaptic.GeoBlazor.Core" Version="' + $CoreVersion + '"') |
Set-Content ..\..\templates\content\dymaptic.GeoBlazor.Template.WebAssembly\dymaptic.GeoBlazor.Template.WebAssembly.csproj

(Get-Content ..\..\templates\content\dymaptic.GeoBlazor.Template.WebApp\dymaptic.GeoBlazor.Template.WebApp\dymaptic.GeoBlazor.Template.WebApp.csproj) `
-replace '\<PackageReference Include="dymaptic.GeoBlazor.Core" Version="[\d\.]*"', ('<PackageReference Include="dymaptic.GeoBlazor.Core" Version="' + $CoreVersion + '"') |
-replace '\<PackageReference Include="dymaptic.GeoBlazor.Core" Version="[\d\.\-\w]*"', ('<PackageReference Include="dymaptic.GeoBlazor.Core" Version="' + $CoreVersion + '"') |
Set-Content ..\..\templates\content\dymaptic.GeoBlazor.Template.WebApp\dymaptic.GeoBlazor.Template.WebApp\dymaptic.GeoBlazor.Template.WebApp.csproj

(Get-Content ..\..\templates\content\dymaptic.GeoBlazor.Template.WebApp\dymaptic.GeoBlazor.Template.WebApp.Client\dymaptic.GeoBlazor.Template.WebApp.Client.csproj) `
-replace '\<PackageReference Include="dymaptic.GeoBlazor.Core" Version="[\d\.]*"', ('<PackageReference Include="dymaptic.GeoBlazor.Core" Version="' + $CoreVersion + '"') |
-replace '\<PackageReference Include="dymaptic.GeoBlazor.Core" Version="[\d\.\-\w]*"', ('<PackageReference Include="dymaptic.GeoBlazor.Core" Version="' + $CoreVersion + '"') |
Set-Content ..\..\templates\content\dymaptic.GeoBlazor.Template.WebApp\dymaptic.GeoBlazor.Template.WebApp.Client\dymaptic.GeoBlazor.Template.WebApp.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="dymaptic.GeoBlazor.Core" Version="3.0.0-beta-1" />
<PackageReference Include="dymaptic.GeoBlazor.Core" Version="3.0.2-beta-3" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="dymaptic.GeoBlazor.Core" Version="3.0.0-beta-1" />
<PackageReference Include="dymaptic.GeoBlazor.Core" Version="3.0.2-beta-3" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="dymaptic.GeoBlazor.Core" Version="3.0.0-beta-1" />
<PackageReference Include="dymaptic.GeoBlazor.Core" Version="3.0.2-beta-3" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0-0" PrivateAssets="all" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<ProjectReference Include="..\dymaptic.GeoBlazor.Template.WebApp.Client\dymaptic.GeoBlazor.Template.WebApp.Client.csproj" />
<PackageReference Include="dymaptic.GeoBlazor.Core" Version="3.0.0-beta-1" />
<PackageReference Include="dymaptic.GeoBlazor.Core" Version="3.0.2-beta-3" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="dymaptic.GeoBlazor.Core" Version="3.0.0-beta-1" />
<PackageReference Include="dymaptic.GeoBlazor.Core" Version="3.0.2-beta-3" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0" PrivateAssets="all" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion templates/dymaptic.GeoBlazor.Templates.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<PackageId>dymaptic.GeoBlazor.Templates</PackageId>
<Title>GeoBlazor Project Templates</Title>
<PackageVersion>3.0.2-beta-1</PackageVersion>
<PackageVersion>3.0.2-beta-3</PackageVersion>
<Version>2.5.2</Version>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Company>dymaptic</Company>
Expand Down
Loading