fix: download release SDK directly from Microsoft Blob

This commit is contained in:
cneicy committed 2026-11-06 19:28:10 +08:00
1 parent a87e4dca32
commit fffd223a85
1 file changed
+8 -2
+8 -2
View File
@@ -5,6 +5,11 @@ on:
tags:
- 'v*'
workflow_dispatch:
inputs:
release_tag:
description: Existing version tag to publish
required: false
type: string
jobs:
publish:
@@ -21,7 +26,7 @@ jobs:
steps:
- name: Fetch exact tagged source
env:
GITEA_REF: ${{ gitea.ref }}
GITEA_REF: ${{ inputs.release_tag || gitea.ref }}
GITEA_REPOSITORY: ${{ gitea.repository }}
shell: bash
run: |
@@ -63,7 +68,8 @@ jobs:
const release = metadata.releases.find(item => item.sdk?.version === sdkVersion);
const file = release?.sdk?.files?.find(item => item.rid === 'linux-x64' && item.name.endsWith('.tar.gz'));
if (!file) throw new Error(`Linux x64 SDK archive not found for ${sdkVersion}`);
const archiveResponse = await fetch(file.url);
const archiveUrl = `https://dotnetcli.blob.core.windows.net/dotnet/Sdk/${sdkVersion}/dotnet-sdk-${sdkVersion}-linux-x64.tar.gz`;
const archiveResponse = await fetch(archiveUrl);
if (!archiveResponse.ok) throw new Error(`SDK download failed: ${archiveResponse.status}`);
await writeFile('/tmp/dotnet-sdk.tar.gz', new Uint8Array(await archiveResponse.arrayBuffer()));