From 756df7f8fa497b4d854d42be6917258f2ac4e2db Mon Sep 17 00:00:00 2001 From: John McKisson Date: Wed, 24 Apr 2024 15:39:20 -0400 Subject: [PATCH] setup github env for upload directory, testing release only --- .github/workflows/build-mudlet.yml | 6 ------ CI/deploy-mudlet-for-windows.ps1 | 25 +++++++++++++++++++------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-mudlet.yml b/.github/workflows/build-mudlet.yml index 814765ec8aa..8f7363b804e 100644 --- a/.github/workflows/build-mudlet.yml +++ b/.github/workflows/build-mudlet.yml @@ -97,12 +97,6 @@ jobs: $Env:GITHUB_PULL_REQUEST_NUMBER = ${{ github.event.pull_request.number }} $Env:GITHUB_PULL_REQUEST_HEAD_SHA = "${{ github.event.pull_request.head.sha }}" & $Env:GITHUB_WORKSPACE\CI\deploy-mudlet-for-windows.ps1 - - name: (Windows) Upload Artifact - if: matrix.os == 'windows-2019' && env.PUBLIC_TEST_BUILD == 'false' - uses: actions/upload-artifact@v2 - with: - name: Mudlet-${{ env.VERSION }}-windows-installer.exe - path: ${{ github.workspace }}/src/release/Setup.exe #- name: (Windows) Install Qt # uses: jurplel/install-qt-action@v3 diff --git a/CI/deploy-mudlet-for-windows.ps1 b/CI/deploy-mudlet-for-windows.ps1 index ce456bb5827..f6a846dbe49 100644 --- a/CI/deploy-mudlet-for-windows.ps1 +++ b/CI/deploy-mudlet-for-windows.ps1 @@ -26,13 +26,26 @@ if ($Env:GITHUB_REPO_TAG -eq "false" -and -Not $Script:PublicTestBuild) { Rename-Item -Path "$Env:GITHUB_WORKSPACE\package-MINGW32-release\mudlet.exe" -NewName "Mudlet.exe" cmd /c 7z a Mudlet-%VERSION%%MUDLET_VERSION_BUILD%-%BUILD_COMMIT%-windows.zip "%GITHUB_WORKSPACE%\package-MINGW32-release\*" - Set-Variable -Name "uri" -Value "https://make.mudlet.org/snapshots/Mudlet-$env:VERSION$env:MUDLET_VERSION_BUILD-$env:BUILD_COMMIT-windows.zip"; - Set-Variable -Name "inFile" -Value "Mudlet-$env:VERSION$env:MUDLET_VERSION_BUILD-$env:BUILD_COMMIT-windows.zip"; - Set-Variable -Name "outFile" -Value "upload-location.txt"; - Write-Output "=== Uploading the snapshot build ===" - Invoke-RestMethod -Uri $uri -Method PUT -InFile $inFile -OutFile $outFile; + #Set-Variable -Name "uri" -Value "https://make.mudlet.org/snapshots/Mudlet-$env:VERSION$env:MUDLET_VERSION_BUILD-$env:BUILD_COMMIT-windows.zip"; + #Set-Variable -Name "inFile" -Value "Mudlet-$env:VERSION$env:MUDLET_VERSION_BUILD-$env:BUILD_COMMIT-windows.zip"; + $uploadFilename = "Mudlet-$env:VERSION$env:MUDLET_VERSION_BUILD-$env:BUILD_COMMIT-windows.zip" + #Set-Variable -Name "outFile" -Value "upload-location.txt"; + #Write-Output "=== Uploading the snapshot build ===" + #Invoke-RestMethod -Uri $uri -Method PUT -InFile $inFile -OutFile $outFile; + + #$DEPLOY_URL = Get-Content -Path $outFile -Raw + Write-Output "=== Setting up upload directory ===" + $uploadDir = "$Env:GITHUB_WORKSPACE\upload" + + if (-not $(Test-Path "$uploadDir")) { + New-Item "$uploadDir" -ItemType "directory" + } - $DEPLOY_URL = Get-Content -Path $outFile -Raw + Write-Output "=== Moving files to upload directory ===" + Move-Item $Env:GITHUB_WORKSPACE\package-MINGW32-release\$uploadFilename $uploadDir + + echo "FOLDER_TO_UPLOAD=$uploadDir" | Out-File -Append -FilePath $Env:GITHUB_ENV + echo "UPLOAD_FILENAME=$uploadFilename" | Out-File -Append -FilePath $Env:GITHUB_ENV } else { if ($Script:PublicTestBuild) {