Skip to content

Commit 705ff8c

Browse files
authored
ci: install xlings via official quick_install script (#29)
Replace the hand-rolled "curl the GitHub release tarball + self install" across ci.yml and release.yml with xlings's official one-click installer (quick_install.sh / quick_install.ps1) pinned to XLINGS_VERSION, matching the mcpp project. The installer has mirror fallback, so it survives the transient GitHub release-CDN 504s that were failing the curl-tarball downloads; the per-curl --retry workarounds are no longer needed.
1 parent 16a2c3f commit 705ff8c

2 files changed

Lines changed: 24 additions & 62 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
env:
99
XLINGS_VERSION: 0.4.51
1010
MCPP_VERSION: 0.0.52
11+
XLINGS_NON_INTERACTIVE: '1'
1112

1213
jobs:
1314
build-linux-mcpp:
@@ -18,11 +19,7 @@ jobs:
1819

1920
- name: Install xlings
2021
run: |
21-
tarball="xlings-${XLINGS_VERSION}-linux-x86_64.tar.gz"
22-
curl -fsSL --retry 10 --retry-all-errors --retry-delay 10 --connect-timeout 30 -o "/tmp/${tarball}" \
23-
"https://github.com/d2learn/xlings/releases/download/v${XLINGS_VERSION}/${tarball}"
24-
tar -xzf "/tmp/${tarball}" -C /tmp
25-
"/tmp/xlings-${XLINGS_VERSION}-linux-x86_64/subos/default/bin/xlings" self install
22+
curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh | bash -s "v${XLINGS_VERSION}"
2623
echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH"
2724
2825
- name: Refresh package index
@@ -58,16 +55,8 @@ jobs:
5855
- uses: actions/checkout@v4
5956

6057
- name: Install xlings
61-
env:
62-
XLINGS_NON_INTERACTIVE: 1
6358
run: |
64-
TARBALL="xlings-${XLINGS_VERSION}-macosx-arm64.tar.gz"
65-
curl -fSL --retry 10 --retry-all-errors --retry-delay 10 --connect-timeout 30 -o "$RUNNER_TEMP/$TARBALL" "https://github.com/d2learn/xlings/releases/download/v${XLINGS_VERSION}/${TARBALL}"
66-
tar -xzf "$RUNNER_TEMP/$TARBALL" -C "$RUNNER_TEMP"
67-
EXTRACT_DIR=$(find "$RUNNER_TEMP" -maxdepth 1 -type d -name "xlings-*" | head -1)
68-
xattr -dr com.apple.quarantine "$EXTRACT_DIR" 2>/dev/null || true
69-
chmod +x "$EXTRACT_DIR/bin/xlings"
70-
"$EXTRACT_DIR/bin/xlings" self install
59+
curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh | bash -s "v${XLINGS_VERSION}"
7160
echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH"
7261
7362
- name: Refresh package index
@@ -89,26 +78,19 @@ jobs:
8978
build-windows:
9079
name: build (windows x86_64, mcpp)
9180
runs-on: windows-latest
92-
defaults:
93-
run:
94-
shell: bash
95-
env:
96-
XLINGS_NON_INTERACTIVE: 1
9781
steps:
9882
- uses: actions/checkout@v4
9983

100-
# Everything in one bash step so the in-process PATH is used directly
101-
# (avoids cross-step PATH translation issues for the msys/Windows mix).
102-
- name: Install xlings and build with mcpp
84+
- name: Install xlings
85+
shell: pwsh
86+
run: |
87+
irm https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.ps1 | iex
88+
"$env:USERPROFILE\.xlings\subos\current\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
89+
90+
- name: Build with mcpp
91+
shell: bash
10392
run: |
10493
set -e
105-
ZIP="xlings-${XLINGS_VERSION}-windows-x86_64.zip"
106-
curl -fSL --retry 10 --retry-all-errors --retry-delay 10 --connect-timeout 30 -o "$RUNNER_TEMP/$ZIP" "https://github.com/d2learn/xlings/releases/download/v${XLINGS_VERSION}/${ZIP}"
107-
unzip -q "$RUNNER_TEMP/$ZIP" -d "$RUNNER_TEMP/xl"
108-
XL=$(find "$RUNNER_TEMP/xl" -name 'xlings.exe' | head -1)
109-
echo "xlings: $XL"
110-
"$XL" self install
111-
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
11294
xlings update
11395
xlings install -y
11496
mcpp build
@@ -128,11 +110,7 @@ jobs:
128110

129111
- name: Install xlings
130112
run: |
131-
tarball="xlings-${XLINGS_VERSION}-linux-x86_64.tar.gz"
132-
curl -fsSL --retry 10 --retry-all-errors --retry-delay 10 --connect-timeout 30 -o "/tmp/${tarball}" \
133-
"https://github.com/d2learn/xlings/releases/download/v${XLINGS_VERSION}/${tarball}"
134-
tar -xzf "/tmp/${tarball}" -C /tmp
135-
"/tmp/xlings-${XLINGS_VERSION}-linux-x86_64/subos/default/bin/xlings" self install
113+
curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh | bash -s "v${XLINGS_VERSION}"
136114
echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH"
137115
138116
- name: Refresh package index

.github/workflows/release.yml

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,8 @@ jobs:
2727
env:
2828
XLINGS_NON_INTERACTIVE: 1
2929
run: |
30-
VERSION_NUM="${XLINGS_VERSION#v}"
31-
TARBALL="xlings-${VERSION_NUM}-linux-x86_64.tar.gz"
32-
curl -fSL --retry 10 --retry-all-errors --retry-delay 10 --connect-timeout 30 -o "$RUNNER_TEMP/$TARBALL" "https://github.com/d2learn/xlings/releases/download/${XLINGS_VERSION}/${TARBALL}"
33-
tar -xzf "$RUNNER_TEMP/$TARBALL" -C "$RUNNER_TEMP"
34-
EXTRACT_DIR=$(find "$RUNNER_TEMP" -maxdepth 1 -type d -name "xlings-*" | head -1)
35-
chmod +x "$EXTRACT_DIR/bin/xlings"
36-
"$EXTRACT_DIR/bin/xlings" self install
37-
echo "PATH=$HOME/.xlings/subos/current/bin:$PATH" >> "$GITHUB_ENV"
30+
curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh | bash -s "${XLINGS_VERSION}"
31+
echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH"
3832
3933
- name: Refresh package index
4034
run: xlings update
@@ -79,15 +73,8 @@ jobs:
7973
env:
8074
XLINGS_NON_INTERACTIVE: 1
8175
run: |
82-
VERSION_NUM="${XLINGS_VERSION#v}"
83-
TARBALL="xlings-${VERSION_NUM}-macosx-arm64.tar.gz"
84-
curl -fSL --retry 10 --retry-all-errors --retry-delay 10 --connect-timeout 30 -o "$RUNNER_TEMP/$TARBALL" "https://github.com/d2learn/xlings/releases/download/${XLINGS_VERSION}/${TARBALL}"
85-
tar -xzf "$RUNNER_TEMP/$TARBALL" -C "$RUNNER_TEMP"
86-
EXTRACT_DIR=$(find "$RUNNER_TEMP" -maxdepth 1 -type d -name "xlings-*" | head -1)
87-
xattr -dr com.apple.quarantine "$EXTRACT_DIR" 2>/dev/null || true
88-
chmod +x "$EXTRACT_DIR/bin/xlings"
89-
"$EXTRACT_DIR/bin/xlings" self install
90-
echo "PATH=$HOME/.xlings/subos/current/bin:$PATH" >> "$GITHUB_ENV"
76+
curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh | bash -s "${XLINGS_VERSION}"
77+
echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH"
9178
9279
- name: Refresh package index
9380
run: xlings update
@@ -122,25 +109,22 @@ jobs:
122109

123110
build-windows:
124111
runs-on: windows-latest
125-
defaults:
126-
run:
127-
shell: bash
128112
env:
129113
XLINGS_NON_INTERACTIVE: 1
130114
steps:
131115
- name: Checkout code
132116
uses: actions/checkout@v4
133117

134-
- name: Install xlings and build with mcpp
118+
- name: Install xlings
119+
shell: pwsh
120+
run: |
121+
irm https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.ps1 | iex
122+
"$env:USERPROFILE\.xlings\subos\current\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
123+
124+
- name: Build & package with mcpp
125+
shell: bash
135126
run: |
136127
set -e
137-
VERSION_NUM="${XLINGS_VERSION#v}"
138-
ZIP="xlings-${VERSION_NUM}-windows-x86_64.zip"
139-
curl -fSL --retry 10 --retry-all-errors --retry-delay 10 --connect-timeout 30 -o "$RUNNER_TEMP/$ZIP" "https://github.com/d2learn/xlings/releases/download/${XLINGS_VERSION}/${ZIP}"
140-
unzip -q "$RUNNER_TEMP/$ZIP" -d "$RUNNER_TEMP/xl"
141-
XL=$(find "$RUNNER_TEMP/xl" -name 'xlings.exe' | head -1)
142-
"$XL" self install
143-
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
144128
xlings update
145129
xlings install -y
146130
mcpp build

0 commit comments

Comments
 (0)