diff --git a/CHANGELIST.md b/CHANGELIST.md index 0dc78fd6..37b89a01 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -12,6 +12,7 @@ - Add commented placeholders instead of omitting - Move function definitions - Smarter mapping of URLs to runtimes +- Unify download maps ### 3.3.0 (2025-01-03) diff --git a/publish-nix.sh b/publish-nix.sh index ef2e3a3a..68410b83 100755 --- a/publish-nix.sh +++ b/publish-nix.sh @@ -76,82 +76,53 @@ VALID_CROSS_PLATFORM_RUNTIMES=("win-arm64" "linux-x64" "linux-arm64" "osx-x64" " # Download programs step function download_programs() { - # Aaru - Skipped for now - AARU_MAP=( - ["linux-arm64"]="https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_linux_arm64.tar.gz", - ["linux-amd64"]="https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_linux_amd64.tar.gz", - ["macos-arm64"]="https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_macos.zip", - ["macos-x64"]="https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_macos.zip", - ["win-arm64"]="https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_windows_aarch64.zip", - ["win-x86"]="https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_windows_x86.zip", - ["win-x64"]="https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_windows_x64.zip", + # Define download constants + DL_PREFIXES=("aaru" "creator" "redumper") + DL_MAP=( + # Aaru - Skipped for now + ["aaru_linux-arm64"]="", #"https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_linux_arm64.tar.gz", + ["aaru_linux-amd64"]="", #"https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_linux_amd64.tar.gz", + ["aaru_macos-arm64"]="", #"https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_macos.zip", + ["aaru_macos-x64"]="", #"https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_macos.zip", + ["aaru_win-arm64"]="", #https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_windows_aarch64.zip", + ["aaru_win-x86"]="", #"https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_windows_x86.zip", + ["aaru_win-x64"]="", #"https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_windows_x64.zip", + + # DiscImageCreator + ["creator_linux-arm64"]="", + ["creator_linux-amd64"]="https://github.com/user-attachments/files/18285720/DiscImageCreator_20250101.tar.gz", + ["creator_macos-arm64"]="https://github.com/user-attachments/files/18285727/DiscImageCreator_20250101.zip", + ["creator_macos-x64"]="https://github.com/user-attachments/files/18285727/DiscImageCreator_20250101.zip", + ["creator_win-arm64"]="", + ["creator_win-x86"]="https://github.com/user-attachments/files/18287520/DiscImageCreator_20250101.zip", + ["creator_win-x64"]="https://github.com/user-attachments/files/18287520/DiscImageCreator_20250101.zip", + + # Redumper + ["redumper_linux-arm64"]="", + ["redumper_linux-amd64"]="https://github.com/superg/redumper/releases/download/build_549/redumper-2025.04.15_build549-Linux64.zip", + ["redumper_macos-arm64"]="https://github.com/superg/redumper/releases/download/build_549/redumper-2025.04.15_build549-Darwin64.zip", + ["redumper_macos-x64"]="https://github.com/superg/redumper/releases/download/build_549/redumper-2025.04.15_build549-Darwin64.zip", + ["redumper_win-arm64"]="", + ["redumper_win-x86"]="https://github.com/superg/redumper/releases/download/build_549/redumper-2025.04.15_build549-Windows32.zip", + ["redumper_win-x64"]="https://github.com/superg/redumper/releases/download/build_549/redumper-2025.04.15_build549-Windows64.zip", ) - # for RUNTIME in "${CHECK_RUNTIMES[@]}"; do - # URL=${AARU_MAP[$RUNTIME]} - # if [ $URL = "" ]; then - # continue - # fi + # Download and extract files + for PREFIX in "${DL_PREFIXES[@]}"; do + for RUNTIME in "${CHECK_RUNTIMES[@]}"; do + URL=${DL_MAP["$PREFIX_$RUNTIME"]} + if [ $URL = "" ]; then + continue + fi - # wget $URL -O aaru-$RUNTIME + wget $URL -O $PREFIX_$RUNTIME - # if [[ $URL =~ \.tar\.gz$ ]]; then - # tar -xvf aaru-$RUNTIME -C aaru-$RUNTIME-dir - # elif - # unzip -u aaru-$RUNTIME -d aaru-$RUNTIME-dir - # fi - # done - - # DiscImageCreator - DIC_MAP=( - ["linux-arm64"]="", - ["linux-amd64"]="https://github.com/user-attachments/files/18285720/DiscImageCreator_20250101.tar.gz", - ["macos-arm64"]="https://github.com/user-attachments/files/18285727/DiscImageCreator_20250101.zip", - ["macos-x64"]="https://github.com/user-attachments/files/18285727/DiscImageCreator_20250101.zip", - ["win-arm64"]="", - ["win-x86"]="https://github.com/user-attachments/files/18287520/DiscImageCreator_20250101.zip", - ["win-x64"]="https://github.com/user-attachments/files/18287520/DiscImageCreator_20250101.zip", - ) - - for RUNTIME in "${CHECK_RUNTIMES[@]}"; do - URL=${DIC_MAP[$RUNTIME]} - if [ $URL = "" ]; then - continue - fi - - wget $URL -O creator-$RUNTIME - - if [[ $URL =~ \.tar\.gz$ ]]; then - tar -xvf creator-$RUNTIME -C creator-$RUNTIME-dir - elif - unzip -u creator-$RUNTIME -d creator-$RUNTIME-dir - fi - done - - # Redumper - REDUMPER_MAP=( - ["linux-arm64"]="", - ["linux-amd64"]="https://github.com/superg/redumper/releases/download/build_549/redumper-2025.04.15_build549-Linux64.zip", - ["macos-arm64"]="https://github.com/superg/redumper/releases/download/build_549/redumper-2025.04.15_build549-Darwin64.zip", - ["macos-x64"]="https://github.com/superg/redumper/releases/download/build_549/redumper-2025.04.15_build549-Darwin64.zip", - ["win-arm64"]="", - ["win-x86"]="https://github.com/superg/redumper/releases/download/build_549/redumper-2025.04.15_build549-Windows32.zip", - ["win-x64"]="https://github.com/superg/redumper/releases/download/build_549/redumper-2025.04.15_build549-Windows64.zip", - ) - - for RUNTIME in "${CHECK_RUNTIMES[@]}"; do - URL=${REDUMPER_MAP[$RUNTIME]} - if [ $URL = "" ]; then - continue - fi - - wget $URL -O redumper-$RUNTIME - - if [[ $URL =~ \.tar\.gz$ ]]; then - tar -xvf redumper-$RUNTIME -C redumper-$RUNTIME-dir - elif - unzip -u redumper-$RUNTIME -d redumper-$RUNTIME-dir - fi + if [[ $URL =~ \.tar\.gz$ ]]; then + tar -xvf $PREFIX_$RUNTIME -C $PREFIX_$RUNTIME-dir + elif + unzip -u $PREFIX_$RUNTIME -d $PREFIX_$RUNTIME-dir + fi + done done } diff --git a/publish-win.ps1 b/publish-win.ps1 index 93e891fd..24eafba4 100644 --- a/publish-win.ps1 +++ b/publish-win.ps1 @@ -66,67 +66,48 @@ $VALID_CROSS_PLATFORM_RUNTIMES = @('win-arm64', 'linux-x64', 'linux-arm64', 'osx # Download programs step function Download-Programs { - # Aaru - Skipped for now - $AARU_MAP = @{ - "linux-arm64" = "https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_linux_arm64.tar.gz" - "linux-amd64" = "https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_linux_amd64.tar.gz" - "macos-arm64" = "https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_macos.zip" - "macos-x64" = "https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_macos.zip" - "win-arm64" = "https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_windows_aarch64.zip" - "win-x86" = "https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_windows_x86.zip" - "win-x64" = "https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_windows_x64.zip" + # Define download constants + $DL_PREFIXES = ("aaru", "creator", "redumper") + $DL_MAP = @{ + # Aaru - Skipped for now + "aaru_linux-arm64" = "" #"https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_linux_arm64.tar.gz" + "aaru_linux-amd64" = "" #"https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_linux_amd64.tar.gz" + "aaru_macos-arm64" = "" #"https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_macos.zip" + "aaru_macos-x64" = "" #"https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_macos.zip" + "aaru_win-arm64" = "" #https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_windows_aarch64.zip" + "aaru_win-x86" = "" #"https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_windows_x86.zip" + "aaru_win-x64" = "" #"https://github.com/aaru-dps/Aaru/releases/download/v5.3.2/aaru-5.3.2_windows_x64.zip" + + # DiscImageCreator + "creator_linux-arm64" = "" + "creator_linux-amd64" = "https://github.com/user-attachments/files/18285720/DiscImageCreator_20250101.tar.gz" + "creator_macos-arm64" = "https://github.com/user-attachments/files/18285727/DiscImageCreator_20250101.zip" + "creator_macos-x64" = "https://github.com/user-attachments/files/18285727/DiscImageCreator_20250101.zip" + "creator_win-arm64" = "" + "creator_win-x86" = "https://github.com/user-attachments/files/18287520/DiscImageCreator_20250101.zip" + "creator_win-x64" = "https://github.com/user-attachments/files/18287520/DiscImageCreator_20250101.zip" + + # Redumper + "redumper_linux-arm64" = "" + "redumper_linux-amd64" = "https://github.com/superg/redumper/releases/download/build_549/redumper-2025.04.15_build549-Linux64.zip" + "redumper_macos-arm64" = "https://github.com/superg/redumper/releases/download/build_549/redumper-2025.04.15_build549-Darwin64.zip" + "redumper_macos-x64" = "https://github.com/superg/redumper/releases/download/build_549/redumper-2025.04.15_build549-Darwin64.zip" + "redumper_win-arm64" = "" + "redumper_win-x86" = "https://github.com/superg/redumper/releases/download/build_549/redumper-2025.04.15_build549-Windows32.zip" + "redumper_win-x64" = "https://github.com/superg/redumper/releases/download/build_549/redumper-2025.04.15_build549-Windows64.zip" } - # foreach ($RUNTIME in $CHECK_RUNTIMES) { - # $URL = $AARU_MAP[$RUNTIME] - # if ( $URL -eq "" ) { - # continue - # } + # Download and extract files + foreach ($PREFIX in $DL_PREFIXES) { + foreach ($RUNTIME in $CHECK_RUNTIMES) { + $URL = $DL_MAP["$PREFIX_$RUNTIME"] + if ( $URL -eq "" ) { + continue + } - # wget $URL -O aaru-$RUNTIME - # Expand-Archive -LiteralPath -u aaru-$RUNTIME -DestinationPath "$BUILD_FOLDER/aaru-$RUNTIME-dir" - # } - - # DiscImageCreator - $DIC_MAP = @{ - "linux-arm64" = "" - "linux-amd64" = "https://github.com/user-attachments/files/18285720/DiscImageCreator_20250101.tar.gz" - "macos-arm64" = "https://github.com/user-attachments/files/18285727/DiscImageCreator_20250101.zip" - "macos-x64" = "https://github.com/user-attachments/files/18285727/DiscImageCreator_20250101.zip" - "win-arm64" = "" - "win-x86" = "https://github.com/user-attachments/files/18287520/DiscImageCreator_20250101.zip" - "win-x64" = "https://github.com/user-attachments/files/18287520/DiscImageCreator_20250101.zip" - } - - foreach ($RUNTIME in $CHECK_RUNTIMES) { - $URL = $DIC_MAP[$RUNTIME] - if ( $URL -eq "" ) { - continue + wget $URL -O $PREFIX_$RUNTIME + Expand-Archive -LiteralPath -u $PREFIX_$RUNTIME -DestinationPath "$BUILD_FOLDER/$PREFIX_$RUNTIME-dir" } - - wget $URL -O creator-$RUNTIME - Expand-Archive -LiteralPath -u creator-$RUNTIME -DestinationPath "$BUILD_FOLDER/creator-$RUNTIME-dir" - } - - # Redumper - $REDUMPER_MAP = @{ - "linux-arm64" = "" - "linux-amd64" = "https://github.com/superg/redumper/releases/download/build_549/redumper-2025.04.15_build549-Linux64.zip" - "macos-arm64" = "https://github.com/superg/redumper/releases/download/build_549/redumper-2025.04.15_build549-Darwin64.zip" - "macos-x64" = "https://github.com/superg/redumper/releases/download/build_549/redumper-2025.04.15_build549-Darwin64.zip" - "win-arm64" = "" - "win-x86" = "https://github.com/superg/redumper/releases/download/build_549/redumper-2025.04.15_build549-Windows32.zip" - "win-x64" = "https://github.com/superg/redumper/releases/download/build_549/redumper-2025.04.15_build549-Windows64.zip" - } - - foreach ($RUNTIME in $CHECK_RUNTIMES) { - $URL = $REDUMPER_MAP[$RUNTIME] - if ( $URL -eq "" ) { - continue - } - - wget $URL -O redumper-$RUNTIME - Expand-Archive -LiteralPath -u redumper-$RUNTIME -DestinationPath "$BUILD_FOLDER/redumper-$RUNTIME-dir" } }