From 8add4429ce16fa3baed6211fd618ecd6de7c2e6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bure=C5=A1?= Date: Sun, 28 Jan 2024 19:01:27 +0100 Subject: [PATCH 1/3] GH Action test --- .github/workflows/build.yml | 38 +++++++++++++++++++++++++++++++++++++ BuildPackage.ps1 | 6 ++++++ 2 files changed, 44 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..b00fc79 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,38 @@ +name: Publish template release + +on: + push + +jobs: + publish: + runs-on: ubuntu-latest + permissions: write-all + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Download NuGet + id: download-nuget + run: sudo curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe + + - name: Install jq + uses: dcarbone/install-jq-action@v2.1.0 + + - name: Build template + id: build-template + run: pwsh -NoProfile -ExecutionPolicy Bypass -File "BuildPackage.ps1" + + - name: Extract current version + id: get-version + run: | + filepath=$(ls -1 dist/SpaceWarp.Template.*.nupkg | head -n 1) + filename=$(basename $filepath) + echo "Artifact name is $filename" + echo "artifact_name=$filename" >> $GITHUB_ENV + echo "artifact_path=$filepath" >> $GITHUB_ENV + + - name: Upload zip as artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ env.artifact_name }} + path: ${{ env.artifact_path }} \ No newline at end of file diff --git a/BuildPackage.ps1 b/BuildPackage.ps1 index 11eef9d..e137113 100644 --- a/BuildPackage.ps1 +++ b/BuildPackage.ps1 @@ -51,6 +51,12 @@ Get-ChildItem -Path "$BuildFolderPath/templates" -Directory | ForEach-Object { $currentTemplateName = $_.Name $Replacements["SpaceWarpTemplateName"] = $currentTemplateName + # Log the entire Replacement dictionary + Write-Host "Replacements for template $currentTemplateName" + $Replacements.GetEnumerator() | ForEach-Object { + Write-Host " $($_.Key) = $($_.Value)" + } + Get-ChildItem -Path $_.FullName -Recurse -File | ForEach-Object { if ($skipExtensions -contains $_.Extension) { Write-Host "Skipped binary file ""$($_.Name)""" From fae28b4fedcdecdabd753a001ef338074c329b26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bure=C5=A1?= Date: Sun, 28 Jan 2024 19:05:06 +0100 Subject: [PATCH 2/3] Added Force parameter to replacement loop --- BuildPackage.ps1 | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/BuildPackage.ps1 b/BuildPackage.ps1 index e137113..18aab26 100644 --- a/BuildPackage.ps1 +++ b/BuildPackage.ps1 @@ -51,13 +51,7 @@ Get-ChildItem -Path "$BuildFolderPath/templates" -Directory | ForEach-Object { $currentTemplateName = $_.Name $Replacements["SpaceWarpTemplateName"] = $currentTemplateName - # Log the entire Replacement dictionary - Write-Host "Replacements for template $currentTemplateName" - $Replacements.GetEnumerator() | ForEach-Object { - Write-Host " $($_.Key) = $($_.Value)" - } - - Get-ChildItem -Path $_.FullName -Recurse -File | ForEach-Object { + Get-ChildItem -Path $_.FullName -Recurse -File -Force | ForEach-Object { if ($skipExtensions -contains $_.Extension) { Write-Host "Skipped binary file ""$($_.Name)""" } else { From 87d2b586f0e095eca09d9f75d4ec0bc6defb89aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bure=C5=A1?= Date: Sun, 28 Jan 2024 19:07:35 +0100 Subject: [PATCH 3/3] Version 1.8.0.6 --- Package.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.nuspec b/Package.nuspec index 7d531d2..a1675ef 100644 --- a/Package.nuspec +++ b/Package.nuspec @@ -2,7 +2,7 @@ SpaceWarp.Template - 1.8.0.5 + 1.8.0.6 munix SpaceWarp Mod Template false