Skip to content

Commit

Permalink
Merge branch 'actions:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
HarithaVattikuti authored Dec 23, 2024
2 parents 51d8fb6 + e4c228a commit 54495d1
Show file tree
Hide file tree
Showing 10 changed files with 682 additions and 264 deletions.
371 changes: 354 additions & 17 deletions .github/workflows/e2e-tests.yml

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions .github/workflows/publish-immutable-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'Publish Immutable Action Version'

on:
release:
types: [created]
types: [published]

jobs:
publish:
Expand All @@ -17,6 +17,4 @@ jobs:
uses: actions/checkout@v4
- name: Publish
id: publish
uses: actions/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
uses: actions/[email protected]
2 changes: 1 addition & 1 deletion .github/workflows/release-new-action-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
steps:
- name: Update the ${{ env.TAG_NAME }} tag
id: update-major-tag
uses: actions/publish-action@v0.2.2
uses: actions/publish-action@v0.3.0
with:
source-tag: ${{ env.TAG_NAME }}
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
24 changes: 23 additions & 1 deletion .github/workflows/test-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,30 @@ jobs:
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-13]
operating-system:
[ubuntu-latest, ubuntu-22.04, windows-latest, macos-13, macos-latest]
dotnet-version: ['2.1', '2.2', '3.0', '3.1', '5.0', '6.0', '7.0', '8.0']
exclude:
- dotnet-version: '2.1'
operating-system: ubuntu-latest
- dotnet-version: '2.2'
operating-system: ubuntu-latest
- dotnet-version: '3.0'
operating-system: ubuntu-latest
- dotnet-version: '3.1'
operating-system: ubuntu-latest
- dotnet-version: '5.0'
operating-system: ubuntu-latest
- dotnet-version: '2.1'
operating-system: macos-latest
- dotnet-version: '2.2'
operating-system: macos-latest
- dotnet-version: '3.0'
operating-system: macos-latest
- dotnet-version: '3.1'
operating-system: macos-latest
- dotnet-version: '5.0'
operating-system: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
9 changes: 6 additions & 3 deletions dist/cache-save/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81174,11 +81174,14 @@ function isCacheFeatureAvailable() {
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
/**
* Returns this action runs on GitHub Enterprise Server or not.
* (port from https://github.com/actions/toolkit/blob/457303960f03375db6f033e214b9f90d79c3fe5c/packages/cache/src/internal/cacheUtils.ts#L134)
*/
function isGhes() {
const url = process.env['GITHUB_SERVER_URL'] || 'https://github.com';
return new URL(url).hostname.toUpperCase() !== 'GITHUB.COM';
const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
const hostname = ghUrl.hostname.trimEnd().toUpperCase();
const isGitHubHost = hostname === 'GITHUB.COM';
const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM');
const isLocalHost = hostname.endsWith('.LOCALHOST');
return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost;
}


Expand Down
9 changes: 6 additions & 3 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93633,11 +93633,14 @@ function isCacheFeatureAvailable() {
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
/**
* Returns this action runs on GitHub Enterprise Server or not.
* (port from https://github.com/actions/toolkit/blob/457303960f03375db6f033e214b9f90d79c3fe5c/packages/cache/src/internal/cacheUtils.ts#L134)
*/
function isGhes() {
const url = process.env['GITHUB_SERVER_URL'] || 'https://github.com';
return new URL(url).hostname.toUpperCase() !== 'GITHUB.COM';
const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
const hostname = ghUrl.hostname.trimEnd().toUpperCase();
const isGitHubHost = hostname === 'GITHUB.COM';
const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM');
const isLocalHost = hostname.endsWith('.LOCALHOST');
return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost;
}


Expand Down
439 changes: 229 additions & 210 deletions externals/install-dotnet.ps1

Large diffs are not rendered by default.

59 changes: 44 additions & 15 deletions externals/install-dotnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -423,11 +423,17 @@ get_normalized_architecture_for_specific_sdk_version() {
# args:
# version or channel - $1
is_arm64_supported() {
#any channel or version that starts with the specified versions
case "$1" in
( "1"* | "2"* | "3"* | "4"* | "5"*)
echo false
return 0
# Extract the major version by splitting on the dot
major_version="${1%%.*}"

# Check if the major version is a valid number and less than 6
case "$major_version" in
[0-9]*)
if [ "$major_version" -lt 6 ]; then
echo false
return 0
fi
;;
esac

echo true
Expand Down Expand Up @@ -950,6 +956,37 @@ get_absolute_path() {
return 0
}

# args:
# override - $1 (boolean, true or false)
get_cp_options() {
eval $invocation

local override="$1"
local override_switch=""

if [ "$override" = false ]; then
override_switch="-n"

# create temporary files to check if 'cp -u' is supported
tmp_dir="$(mktemp -d)"
tmp_file="$tmp_dir/testfile"
tmp_file2="$tmp_dir/testfile2"

touch "$tmp_file"

# use -u instead of -n if it's available
if cp -u "$tmp_file" "$tmp_file2" 2>/dev/null; then
override_switch="-u"
fi

# clean up
rm -f "$tmp_file" "$tmp_file2"
rm -rf "$tmp_dir"
fi

echo "$override_switch"
}

# args:
# input_files - stdin
# root_path - $1
Expand All @@ -961,15 +998,7 @@ copy_files_or_dirs_from_list() {
local root_path="$(remove_trailing_slash "$1")"
local out_path="$(remove_trailing_slash "$2")"
local override="$3"
local osname="$(get_current_os_name)"
local override_switch=$(
if [ "$override" = false ]; then
if [ "$osname" = "linux-musl" ]; then
printf -- "-u";
else
printf -- "-n";
fi
fi)
local override_switch="$(get_cp_options "$override")"

cat | uniq | while read -r file_path; do
local path="$(remove_beginning_slash "${file_path#$root_path}")"
Expand Down Expand Up @@ -1735,7 +1764,7 @@ do
zip_path="$1"
;;
-?|--?|-h|--help|-[Hh]elp)
script_name="$(basename "$0")"
script_name="dotnet-install.sh"
echo ".NET Tools Installer"
echo "Usage:"
echo " # Install a .NET SDK of a given Quality from a given Channel"
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions src/cache-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,16 @@ export function isCacheFeatureAvailable(): boolean {

/**
* Returns this action runs on GitHub Enterprise Server or not.
* (port from https://github.com/actions/toolkit/blob/457303960f03375db6f033e214b9f90d79c3fe5c/packages/cache/src/internal/cacheUtils.ts#L134)
*/
function isGhes(): boolean {
const url = process.env['GITHUB_SERVER_URL'] || 'https://github.com';
return new URL(url).hostname.toUpperCase() !== 'GITHUB.COM';
const ghUrl = new URL(
process.env['GITHUB_SERVER_URL'] || 'https://github.com'
);

const hostname = ghUrl.hostname.trimEnd().toUpperCase();
const isGitHubHost = hostname === 'GITHUB.COM';
const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM');
const isLocalHost = hostname.endsWith('.LOCALHOST');

return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost;
}

0 comments on commit 54495d1

Please sign in to comment.