1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-22 23:56:13 +01:00

Got tag version and URL

This commit is contained in:
peteGSX 2023-04-05 05:30:00 +10:00
parent 3a3071f35b
commit 61db37c7ea

View File

@ -20,10 +20,11 @@
# 32/64 bit Win installer
# https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Windows_32bit.zip
# https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Windows_64bit.zip
#
# For script errors set ExecutionPolicy:
# Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass
$gitHubAPITags = "https://api.github.com/repos/DCC-EX/CommandStation-EX/git/refs/tags"
param(
Param(
[Parameter()]
[String]$buildDirectory
)
@ -34,6 +35,8 @@ if (!$PSBoundParameters.ContainsKey('buildDirectory')) {
$buildDirectory = $env:TEMP + "\" + $buildDate
}
$gitHubAPITags = "https://api.github.com/repos/DCC-EX/CommandStation-EX/git/refs/tags"
if ((Get-WmiObject win32_operatingsystem | Select-Object osarchitecture).osarchitecture -eq "64-bit") {
$arduinoCLIURL = "https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Windows_64bit.zip"
$arduinoCLIZip = $env:TEMP + "\" + "arduino-cli_latest_Windows_64bit.zip"
@ -54,6 +57,12 @@ $ProgressPreference = "Continue"
Write-Output "Installing using directory $buildDirectory"
foreach ($tag in Invoke-RestMethod -Uri $gitHubAPITags | Format-List -Property ref) {
$tag.getType()
$tagList = Invoke-RestMethod -Uri $gitHubAPITags
# Example zip: https://github.com/DCC-EX/CommandStation-EX/archive/refs/tags/v4.2.36-Devel.zip
foreach ($tag in $tagList) {
$version = $tag.ref.split("/")[2]
$versionURL = "https://github.com/DCC-EX/CommandStation-EX/archive/" + $tag.ref
Write-Output "$version : $versionURL"
}