Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Host MELEE_COMPILERS_N.zip on MEGA instead of Discord #979

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ The easiest way to get set up is with [scoop](https://scoop.sh/). You will also
git clone 'https://github.com/doldecomp/melee.git'
cd melee
```
1. Download our [compilers zip archive](https://cdn.discordapp.com/attachments/727909624342380615/1129879865433264158/MELEE_COMPILERS_N.zip) and rename the `GC` subfolder to `mwcc_compiler`, and place it in `/tools`. You can do this manually, or use the following PowerShell snippet (from inside your melee directory):
1. Download our [compilers zip archive](https://mega.nz/file/BU43wKxT#rVC11Rl7DPxfSn7V9Iu--8E7m7gc1gsJWtfVBbfmKwQ) and rename the `GC` subfolder to `mwcc_compiler`, and place it in `/tools`. You can do this manually, or use the following PowerShell snippet (from inside your melee directory):
```ps1
$url = 'https://cdn.discordapp.com/attachments/727909624342380615/1129879865433264158/MELEE_COMPILERS_N.zip'
$tmp = New-TemporaryFile
Invoke-WebRequest -Uri $url -OutFile $tmp
$zip = Rename-Item $tmp -NewName ($tmp.BaseName + '.zip') -PassThru
& scoop install megatools
$url = 'https://mega.nz/file/BU43wKxT#rVC11Rl7DPxfSn7V9Iu--8E7m7gc1gsJWtfVBbfmKwQ'
$zip = [System.IO.Path]::GetTempFileName() -replace '\.[^.]+$','.zip'
& megatools dl --no-progress --path "$zip" "$url"

$dir = New-Item -ItemType Directory `
-Path (Join-Path $env:Temp 'MELEE_COMPILERS')
Expand All @@ -51,6 +51,9 @@ The easiest way to get set up is with [scoop](https://scoop.sh/). You will also

Remove-Item -Force $zip
Remove-Item -Recurse -Force $dir

# Optional: Uninstall megatools
& scoop uninstall megatools
```
1. Run `make` using `bash` to build the project:
```ps1
Expand Down
2 changes: 1 addition & 1 deletion .github/packages/build-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ COPY --from=devkitpro/devkitppc:latest \
COPY .github/packages/build-linux/setup.sh /usr/local/bin
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C
ENV MELEE_COMPILERS_URL="https://cdn.discordapp.com/attachments/727909624342380615/1129879865433264158/MELEE_COMPILERS_N.zip"
ENV MELEE_COMPILERS_URL="https://mega.nz/file/BU43wKxT#rVC11Rl7DPxfSn7V9Iu--8E7m7gc1gsJWtfVBbfmKwQ"
RUN chmod +x /usr/local/bin/setup.sh && setup.sh
VOLUME [ "/input", "/output" ]
ENV WINE=${WIBO_PATH}
Expand Down
6 changes: 3 additions & 3 deletions .github/packages/build-linux/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ apt install -y --no-install-recommends \
libc6-dev \
python3-full \
python-is-python3 \
curl \
megatools \
libarchive-tools

curl -L "$MELEE_COMPILERS_URL" |
megadl --no-progress "$MELEE_COMPILERS_URL" --path - |
bsdtar -xvf- -C /tmp
mv /tmp/GC /tmp/mwcc_compiler
mv /tmp/mwcc_compiler /opt

apt remove -y \
curl \
megatools \
libarchive-tools
apt autoremove -y
apt clean
Expand Down
2 changes: 1 addition & 1 deletion .github/packages/build-windows/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RUN net user melee /add; \
# grant melee user read access to requirements.txt
icacls 'C:/Windows/Temp/requirements.txt' /grant 'melee:(R)';
USER melee
ENV MELEE_COMPILERS_URL="https://cdn.discordapp.com/attachments/727909624342380615/1129879865433264158/MELEE_COMPILERS_N.zip"
ENV MELEE_COMPILERS_URL="https://mega.nz/file/BU43wKxT#rVC11Rl7DPxfSn7V9Iu--8E7m7gc1gsJWtfVBbfmKwQ"
RUN setup.ps1
VOLUME [ "C:/Input", "C:/Output" ]
ENTRYPOINT entrypoint.ps1
9 changes: 5 additions & 4 deletions .github/packages/build-windows/setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
& scoop install `
git `
python `
mingw
mingw `
megatools
if ($LASTEXITCODE -ne 0)
{
Exit $LASTEXITCODE
Expand Down Expand Up @@ -49,10 +50,9 @@ $data = New-Item -Path "$env:LocalAppData/Melee" -ItemType Directory

# download and save melee compilers
& {
$tmp = New-TemporaryFile
Invoke-WebRequest -Uri "$env:MELEE_COMPILERS_URL" -OutFile $tmp
# Expand-Archive won't unzip it if its extension isn't .zip lol
$zip = Rename-Item $tmp -NewName ($tmp.BaseName + '.zip') -PassThru
$zip = [System.IO.Path]::GetTempFileName() -replace '\.[^.]+$','.zip'
& megatools dl --no-progress --path "$zip" "$env:MELEE_COMPILERS_URL"

$dir = New-Item -ItemType Directory `
-Path (Join-Path $env:Temp 'MELEE_COMPILERS')
Expand All @@ -65,4 +65,5 @@ $data = New-Item -Path "$env:LocalAppData/Melee" -ItemType Directory

Remove-Item -Force $zip
Remove-Item -Recurse -Force $dir
& scoop uninstall megatools
}