Skip to content

Commit 39fa7d0

Browse files
authored
From curl to Invoke-WebRequest (#7)
* From curl to Invoke-WebRequest * Moved Windows to https://www.lieberlieber.com/lemontree/automation/latest because the nexus location is not working on "windows-latest"
1 parent 28e2b68 commit 39fa7d0

File tree

4 files changed

+28
-25
lines changed

4 files changed

+28
-25
lines changed

.github/workflows/TestGetLemonTreeAutomationAction.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ jobs:
1111
runs-on: [windows-latest]
1212
timeout-minutes: 15
1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515
with:
1616
lfs: true
1717
fetch-depth: 0
1818

1919
- name: GetLTA
20-
uses: LieberLieber/setup-LemonTree.Automation@v4
20+
uses: LieberLieber/setup-LemonTree.Automation@v5
2121
id: GetLTA
2222
with:
2323
License: ${{secrets.LTALICENSE}}

.github/workflows/TestUbuntuGetLemonTreeAutomationAction.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121
timeout-minutes: 15
2222
steps:
23-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2424
with:
2525
lfs: true
2626
fetch-depth: 0

.github/workflows/TestWindowsGetLemonTreeAutomationAction.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: windows-latest
2121
timeout-minutes: 15
2222
steps:
23-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2424
with:
2525
lfs: true
2626
fetch-depth: 0

getLTA.ps1

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ if ($RunnerOs -eq 'Linux')
1212
}
1313
elseif ($RunnerOs -eq 'Windows')
1414
{
15-
$LemonTreePackageURL = "https://nexus.lieberlieber.com/repository/lemontree-release/LemonTree.Automation/LemonTree.Automation.Windows.Zip_latest.zip"
15+
# somehow nexus is super slow on windows-latest
16+
# $LemonTreePackageURL = "https://nexus.lieberlieber.com/repository/lemontree-release/LemonTree.Automation/LemonTree.Automation.Windows.Zip_latest.zip"
17+
$LemonTreePackageURL = "https://www.lieberlieber.com/lemontree/automation/latest"
1618
}
1719
else
1820
{
@@ -21,11 +23,13 @@ else
2123
}
2224

2325
Write-Output "Download LemonTree.Automtion from Repo"
24-
while (Test-Path Alias:curl) {Remove-Item Alias:curl} #remove the alias binding from curl to Invoke-WebRequest
25-
curl "$LemonTreePackageURL" --output LTA.zip -k
26-
Expand-Archive LTA.zip -DestinationPath .\LTA\ -Force
26+
# while (Test-Path Alias:curl) {Remove-Item Alias:curl} #remove the alias binding from curl to Invoke-WebRequest
27+
# curl "$LemonTreePackageURL" --output LTA.zip -k
28+
Invoke-WebRequest -URI "$LemonTreePackageURL" -OutFile "LTA.zip"
29+
Expand-Archive "LTA.zip" -DestinationPath ".\LTA\" -Force
2730

28-
IF([string]::IsNullOrWhiteSpace($License))
31+
32+
if([string]::IsNullOrWhiteSpace($License))
2933
{
3034
Write-Output "No License info provided."
3135
}
@@ -35,21 +39,20 @@ else
3539
$License | Out-File -FilePath lta.lic #if you deploy the license on the fly
3640
}
3741

38-
if($LASTEXITCODE -eq 0)
42+
if ($RunnerOs -eq 'Linux')
3943
{
40-
41-
if ($RunnerOs -eq 'Linux')
42-
{
43-
$LemonTreeExe = "./LTA/LemonTree.Automation"
44-
#workaround because github artifacts logic doesn't maintain properties
45-
chmod +x $LemonTreeExe
46-
}
47-
elseif ($RunnerOs -eq 'Windows')
48-
{
49-
$LemonTreeExe = ".\LTA\LemonTree.Automation.exe"
50-
}
51-
52-
Write-Output "LemonTreeAutomationExecutable=$LemonTreeExe" >> $env:GITHUB_OUTPUT
53-
#workaround because LemonTree.Automation.exe Version provides misleading Exitcode
54-
exit 0
44+
$LemonTreeExe = "./LTA/LemonTree.Automation"
45+
#workaround because github artifacts logic doesn't maintain properties
46+
chmod +x $LemonTreeExe
47+
}
48+
elseif ($RunnerOs -eq 'Windows')
49+
{
50+
$LemonTreeExe = ".\LTA\LemonTree.Automation.exe"
5551
}
52+
53+
#Just to be sure if the executeable is not available - let's throw exitcode 1
54+
55+
56+
Write-Output "LemonTreeAutomationExecutable=$LemonTreeExe" >> $env:GITHUB_OUTPUT
57+
58+
exit 0

0 commit comments

Comments
 (0)