Skip to content

Commit

Permalink
V1 - Use new .NET CDN URLs and update to latest install scripts (#569)
Browse files Browse the repository at this point in the history
* New cdn url changes

* Fix CI failures on macos-latest

* Add Fallback logic

* Fix proxy failures

* Update signed version
  • Loading branch information
HarithaVattikuti authored Dec 26, 2024
1 parent 608ee75 commit 71a4fd9
Show file tree
Hide file tree
Showing 7 changed files with 2,029 additions and 1,555 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
id: diff

# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
operating-system: [ubuntu-22.04, windows-latest, macOS-latest]
dotnet-version: ['2.1', '2.2', '3.0', '3.1', '5.0']
steps:
- name: Checkout
Expand Down
24 changes: 13 additions & 11 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
operating-system: [ubuntu-22.04, windows-latest, macos-13]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -38,7 +38,7 @@ jobs:
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
operating-system: [ubuntu-22.04, windows-latest, macOS-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -61,7 +61,7 @@ jobs:
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
operating-system: [ubuntu-22.04, windows-latest, macos-13]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
operating-system: [ubuntu-22.04, windows-latest, macOS-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -119,7 +119,7 @@ jobs:
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
operating-system: [ubuntu-22.04, windows-latest, macOS-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -143,7 +143,7 @@ jobs:
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
operating-system: [ubuntu-22.04, windows-latest, macOS-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -163,18 +163,20 @@ jobs:
run: __tests__/verify-dotnet.ps1 3.1 2.2

test-proxy:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
container:
image: mcr.microsoft.com/dotnet/core/runtime-deps:3.0-bionic
image: ubuntu:20.04
options: --dns 127.0.0.1
services:
squid-proxy:
image: datadog/squid:latest
image: ubuntu/squid:latest
ports:
- 3128:3128
env:
https_proxy: http://squid-proxy:3128
http_proxy: http://squid-proxy:3128
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: true

steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -183,7 +185,7 @@ jobs:
- name: Install curl
run: |
apt update
apt -y install curl
apt -y install curl libssl-dev
- name: Setup dotnet 3.1.201
uses: ./
with:
Expand All @@ -195,7 +197,7 @@ jobs:
run: __tests__/verify-dotnet.sh 3.1.201

test-bypass-proxy:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
env:
https_proxy: http://no-such-proxy:3128
no_proxy: github.com,dotnetcli.blob.core.windows.net,download.visualstudio.microsoft.com,api.nuget.org,dotnetcli.azureedge.net
Expand Down
11 changes: 9 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18168,7 +18168,13 @@ class DotnetCoreInstaller {
}
getReleasesJsonUrl(httpClient, versionParts) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield httpClient.getJson(DotNetCoreIndexUrl);
let response;
try {
response = yield httpClient.getJson(DotNetCoreIndexUrl);
}
catch (error) {
response = yield httpClient.getJson(DotnetCoreIndexFallbackUrl);
}
const result = response.result || {};
let releasesInfo = result['releases-index'];
releasesInfo = releasesInfo.filter((info) => {
Expand All @@ -18192,7 +18198,8 @@ class DotnetCoreInstaller {
}
}
exports.DotnetCoreInstaller = DotnetCoreInstaller;
const DotNetCoreIndexUrl = 'https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json';
const DotNetCoreIndexUrl = 'https://builds.dotnet.microsoft.com/dotnet/release-metadata/releases-index.json';
const DotnetCoreIndexFallbackUrl = 'https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json';


/***/ }),
Expand Down
Loading

0 comments on commit 71a4fd9

Please sign in to comment.