Skip to content

Commit

Permalink
setup github env for upload directory, testing release only
Browse files Browse the repository at this point in the history
  • Loading branch information
jmckisson committed Apr 24, 2024
1 parent edd55ef commit 756df7f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/build-mudlet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 19 additions & 6 deletions CI/deploy-mudlet-for-windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down

0 comments on commit 756df7f

Please sign in to comment.