From bfd42ebafad53c7ac2f4d13be6002503ebe737be Mon Sep 17 00:00:00 2001 From: irkode Date: Tue, 20 Aug 2024 11:37:57 +0200 Subject: [PATCH] add download and list --- .github/workflows/build.yml | 25 ++++++++++++++----------- .gitignore | 3 --- 2 files changed, 14 insertions(+), 14 deletions(-) delete mode 100644 .gitignore diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 04d2d2d..6416392 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,9 +37,9 @@ jobs: Remove-Item -Recurse .\assets -ErrorAction SilentlyContinue Remove-Item -Recurse .\.github -ErrorAction SilentlyContinue Remove-Item .\.gitignore -ErrorAction SilentlyContinue - if (Test-Path .\assets) { throw ".\assets should not exist"} - if (Test-Path .\.github) { throw ".\assets should not exist"} - if (Test-Path .\.gitignore) { throw ".\assets should not exist"} + [void](Test-Path .\assets -ErrorAction Stop) + [void](Test-Path .\.github -ErrorAction Stop) + [void](Test-Path .\.gitignore -ErrorAction Stop) - name: Download Bulma run: | @@ -63,15 +63,16 @@ jobs: $BulmaRelease = $BulmaReleases | Where-Object { -Not $_.known } | Select-Object -First 1 if ($BulmaRelease) { Write-Output "Downloading Bulma $($BulmaRelease.release)" - #Invoke-WebRequest -Uri $BulmaRelease.download -OutFile $BulmaRelease.archive - #$bulmaFolder = (Get-Item $BulmaRelease.archive).Basename + Invoke-WebRequest -Uri $BulmaRelease.download -OutFile $BulmaRelease.archive + [void](Test-Path $BulmaRelease.archive -ErrorAction Stop) + $bulmaFolder = (Get-Item $BulmaRelease.archive).Basename - #[void](New-Item -Type Directory ./assets -ErrorAction Stop) - #if (-Not (Test-Path .\assets -PathType Container)) { throw "missing folder: assets"} - #Expand-Archive -LiteralPath $BulmaRelease.archive -DestinationPath .\assets - #if (Test-Path .\assets\__MACOSX) { Remove-Item .\assets\__MACOSX -ErrorAction SilentlyContinue -Recurse } - #Rename-Item .\assets\$bulmaFolder "bulma" - #if (-Not (Test-Path ./assets/bulma -PathType Container)) { throw "missing folder: assets/bulma folder"} + [void](New-Item -Type Directory ./assets -ErrorAction Stop) + [void](Test-Path .\assets -PathType Container -ErrorAction Stop) + Expand-Archive -LiteralPath $BulmaRelease.archive -DestinationPath .\assets + if (Test-Path .\assets\__MACOSX) { Remove-Item .\assets\__MACOSX -ErrorAction SilentlyContinue -Recurse } + Rename-Item .\assets\$bulmaFolder "bulma" + [void](Test-Path ./assets/bulma -PathType Container -ErrorAction Stop) echo "BULMA_RELEASE=$($BulmaRelease.release)" | Out-File $Env:GITHUB_ENV -Append -Encoding utf8 echo "BULMA_ARCHIVE=$($BulmaRelease.archive)" | Out-File $Env:GITHUB_ENV -Append -Encoding utf8 Write-Output "download successful: $($BulmaRelease.archive)" @@ -84,6 +85,8 @@ jobs: Write-Host "Creating Release for $ENV:BULMA_RELEASE : $ENV:BULMA_ARCHIVE" $BulmaRelease = "$ENV:BULMA_RELEASE" $BulmaArchive = "$ENV:BULMA_ARCHIVE" + $cwd = ($pwd.Path -replace "\\","\\") + "\\" + (Get-ChildItem . -recurse).FullName -replace $cwd, ""|sort #git checkout -b "bulma-$BulmaRelease" #Remove-Item $BulmaArchive -ErrorAction SilentlyContinue #if (Test-Path $BulmaArchive { throw "failed to remove downloaded archive: $BulmaArchive" } diff --git a/.gitignore b/.gitignore deleted file mode 100644 index bd7ab00..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -backup/ -src/ -workflow.ps1