Compare commits

..

6 Commits

Author SHA1 Message Date
3e891b0cb6 Revise isGhes logic (#556)
* Revise `isGhes` logic

* `isGhes` should not be exported

* ran `npm run format` and `npm run build`

* ran `npm run update-installers`
2024-10-21 13:32:55 -05:00
2e0b25913c Merge pull request #550 from actions/Jcambass-patch-2
Upgrade IA Publish
2024-09-26 08:24:24 +02:00
29640e4139 Upgrade IA Publish 2024-09-16 17:20:55 +02:00
cbeba61921 Merge pull request #548 from actions/Jcambass-patch-1
Add workflow file for publishing releases to immutable action package
2024-09-11 16:48:58 +02:00
344ba5f715 Add workflow file for publishing releases to immutable action package
This workflow file publishes new action releases to the immutable action package of the same name as this repo.

This is part of the Immutable Actions project which is not yet fully released to the public. First party actions like this one are part of our initial testing of this feature.
2024-09-11 12:09:14 +02:00
9be03d3dab Fix failure checks (#545) 2024-08-28 17:22:02 -05:00
5 changed files with 64 additions and 24 deletions

View File

@ -0,0 +1,20 @@
name: 'Publish Immutable Action Version'
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
steps:
- name: Checking out
uses: actions/checkout@v4
- name: Publish
id: publish
uses: actions/publish-immutable-action@0.0.3

View File

@ -81174,11 +81174,14 @@ function isCacheFeatureAvailable() {
exports.isCacheFeatureAvailable = isCacheFeatureAvailable; exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
/** /**
* Returns this action runs on GitHub Enterprise Server or not. * 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() { function isGhes() {
const url = process.env['GITHUB_SERVER_URL'] || 'https://github.com'; const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
return new URL(url).hostname.toUpperCase() !== '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;
} }

9
dist/setup/index.js vendored
View File

@ -93633,11 +93633,14 @@ function isCacheFeatureAvailable() {
exports.isCacheFeatureAvailable = isCacheFeatureAvailable; exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
/** /**
* Returns this action runs on GitHub Enterprise Server or not. * 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() { function isGhes() {
const url = process.env['GITHUB_SERVER_URL'] || 'https://github.com'; const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
return new URL(url).hostname.toUpperCase() !== '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;
} }

View File

@ -423,11 +423,17 @@ get_normalized_architecture_for_specific_sdk_version() {
# args: # args:
# version or channel - $1 # version or channel - $1
is_arm64_supported() { is_arm64_supported() {
#any channel or version that starts with the specified versions # Extract the major version by splitting on the dot
case "$1" in major_version="${1%%.*}"
( "1"* | "2"* | "3"* | "4"* | "5"*)
echo false # Check if the major version is a valid number and less than 6
return 0 case "$major_version" in
[0-9]*)
if [ "$major_version" -lt 6 ]; then
echo false
return 0
fi
;;
esac esac
echo true echo true
@ -961,15 +967,16 @@ copy_files_or_dirs_from_list() {
local root_path="$(remove_trailing_slash "$1")" local root_path="$(remove_trailing_slash "$1")"
local out_path="$(remove_trailing_slash "$2")" local out_path="$(remove_trailing_slash "$2")"
local override="$3" local override="$3"
local osname="$(get_current_os_name)" local override_switch=""
local override_switch=$(
if [ "$override" = false ]; then if [ "$override" = false ]; then
if [ "$osname" = "linux-musl" ]; then override_switch="-n"
printf -- "-u";
else # use -u instead of -n when it's available
printf -- "-n"; if cp -u --help >/dev/null 2>&1; then
fi override_switch="-u"
fi) fi
fi
cat | uniq | while read -r file_path; do cat | uniq | while read -r file_path; do
local path="$(remove_beginning_slash "${file_path#$root_path}")" local path="$(remove_beginning_slash "${file_path#$root_path}")"
@ -1735,7 +1742,7 @@ do
zip_path="$1" zip_path="$1"
;; ;;
-?|--?|-h|--help|-[Hh]elp) -?|--?|-h|--help|-[Hh]elp)
script_name="$(basename "$0")" script_name="dotnet-install.sh"
echo ".NET Tools Installer" echo ".NET Tools Installer"
echo "Usage:" echo "Usage:"
echo " # Install a .NET SDK of a given Quality from a given Channel" echo " # Install a .NET SDK of a given Quality from a given Channel"

View File

@ -90,9 +90,16 @@ export function isCacheFeatureAvailable(): boolean {
/** /**
* Returns this action runs on GitHub Enterprise Server or not. * 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 { function isGhes(): boolean {
const url = process.env['GITHUB_SERVER_URL'] || 'https://github.com'; const ghUrl = new URL(
return new URL(url).hostname.toUpperCase() !== 'GITHUB.COM'; 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;
} }