|
1 | 1 | name: Setup C++23 Toolchain |
2 | 2 | description: Install xlings and project dependencies declared in .xlings.json |
3 | 3 |
|
| 4 | +inputs: |
| 5 | + token: |
| 6 | + description: 'GitHub token for downloading xlings releases' |
| 7 | + required: true |
| 8 | + |
4 | 9 | runs: |
5 | 10 | using: composite |
6 | 11 | steps: |
7 | 12 | - name: Install xlings (linux) |
8 | 13 | if: runner.os == 'Linux' |
9 | 14 | shell: bash |
10 | 15 | run: | |
11 | | - LATEST_VERSION=$(curl -s https://api.github.com/repos/d2learn/xlings/releases/latest | grep '"tag_name"' | sed 's/.*"tag_name": *"\([^"]*\)".*/\1/') |
| 16 | + LATEST_VERSION=$(gh release view --repo d2learn/xlings --json tagName -q '.tagName') |
12 | 17 | VERSION_NUM=${LATEST_VERSION#v} |
13 | 18 | TARBALL="xlings-${VERSION_NUM}-linux-x86_64.tar.gz" |
14 | | - curl -sL "https://github.com/d2learn/xlings/releases/download/${LATEST_VERSION}/${TARBALL}" -o "/tmp/${TARBALL}" |
| 19 | + gh release download "$LATEST_VERSION" --repo d2learn/xlings --pattern "$TARBALL" --dir /tmp |
15 | 20 | mkdir -p "$HOME/.xlings" |
16 | | - tar -xzf "/tmp/${TARBALL}" -C "$HOME/.xlings" --strip-components=1 |
| 21 | + tar -xzf "/tmp/$TARBALL" -C "$HOME/.xlings" --strip-components=1 |
17 | 22 | "$HOME/.xlings/bin/xlings" self install |
| 23 | + env: |
| 24 | + GH_TOKEN: ${{ inputs.token }} |
18 | 25 |
|
19 | 26 | - name: Install xlings (macos) |
20 | 27 | if: runner.os == 'macOS' |
21 | 28 | shell: bash |
22 | 29 | run: | |
23 | | - LATEST_VERSION=$(curl -s https://api.github.com/repos/d2learn/xlings/releases/latest | grep '"tag_name"' | sed 's/.*"tag_name": *"\([^"]*\)".*/\1/') |
| 30 | + LATEST_VERSION=$(gh release view --repo d2learn/xlings --json tagName -q '.tagName') |
24 | 31 | VERSION_NUM=${LATEST_VERSION#v} |
25 | 32 | ARCH=$(uname -m) |
26 | 33 | TARBALL="xlings-${VERSION_NUM}-macosx-${ARCH}.tar.gz" |
27 | | - curl -sL "https://github.com/d2learn/xlings/releases/download/${LATEST_VERSION}/${TARBALL}" -o "/tmp/${TARBALL}" |
| 34 | + gh release download "$LATEST_VERSION" --repo d2learn/xlings --pattern "$TARBALL" --dir /tmp |
28 | 35 | mkdir -p "$HOME/.xlings" |
29 | | - tar -xzf "/tmp/${TARBALL}" -C "$HOME/.xlings" --strip-components=1 |
| 36 | + tar -xzf "/tmp/$TARBALL" -C "$HOME/.xlings" --strip-components=1 |
30 | 37 | xattr -dr com.apple.quarantine "$HOME/.xlings" 2>/dev/null || true |
31 | 38 | "$HOME/.xlings/bin/xlings" self install |
| 39 | + env: |
| 40 | + GH_TOKEN: ${{ inputs.token }} |
32 | 41 |
|
33 | 42 | - name: Install xlings (windows) |
34 | 43 | if: runner.os == 'Windows' |
|
0 commit comments