Skip to content

Commit dd6004c

Browse files
committed
swap curl for gh cli for downloading releases
1 parent 351e279 commit dd6004c

1 file changed

Lines changed: 7 additions & 21 deletions

File tree

.github/actions/setup-muse2-release/action.yml

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,16 @@ inputs:
1010
runs:
1111
using: composite
1212
steps:
13-
- name: Get latest MUSE2 release tag
14-
id: muse2_release
15-
shell: bash
16-
run: |
17-
TAG=$(curl -sSf \
18-
-H "Accept: application/vnd.github+json" \
19-
-H "Authorization: Bearer ${{ inputs.github_token }}" \
20-
https://api.github.com/repos/EnergySystemsModellingLab/MUSE2/releases/latest \
21-
| jq -r '.tag_name')
22-
23-
if [[ -z "$TAG" || "$TAG" == "null" ]]; then
24-
echo "::error::Failed to retrieve latest MUSE2 release tag."
25-
exit 1
26-
fi
27-
28-
echo "Resolved latest MUSE2 release: $TAG"
29-
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
30-
3113
- name: Download MUSE2 release asset
3214
shell: bash
15+
env:
16+
GITHUB_TOKEN: ${{ inputs.github_token }}
3317
run: |
34-
curl -sSfL \
35-
"https://github.com/EnergySystemsModellingLab/MUSE2/releases/download/${{ steps.muse2_release.outputs.tag }}/${{ runner.os == 'Windows' && 'muse2_windows.zip' || runner.os == 'macOS' && 'muse2_macos_arm.tar.gz' || 'muse2_linux.tar.gz' }}" \
36-
--output "muse2_asset_download"
18+
gh release download \
19+
--repo EnergySystemsModellingLab/MUSE2 \
20+
--pattern "${{ runner.os == 'Windows' && 'muse2_windows.zip' || runner.os == 'macOS' && 'muse2_macos_arm.tar.gz' || 'muse2_linux.tar.gz' }}" \
21+
--output "muse2_asset_download" \
22+
--clobber
3723
3824
- name: Extract and set MUSE2_PATH (Linux / macOS)
3925
if: runner.os == 'Linux' || runner.os == 'macOS'

0 commit comments

Comments
 (0)