Skip to content

Commit

Permalink
GH Action test
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-bures committed Jan 28, 2024
1 parent 968f589 commit 8add442
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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 }}
6 changes: 6 additions & 0 deletions BuildPackage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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)"""
Expand Down

0 comments on commit 8add442

Please sign in to comment.