Skip to content

Commit 53d632b

Browse files
author
Vladimir Safonkin
authored
Update docs to v2 (#278)
* Update docs to v2 * Bump checkout action to v3 * Update installer scripts * Replace v2 to vX on the docs, minor fixes * Remove extra whitespace
1 parent 9211491 commit 53d632b

File tree

7 files changed

+66
-64
lines changed

7 files changed

+66
-64
lines changed

.github/workflows/check-dist.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ jobs:
2121
runs-on: ubuntu-latest
2222

2323
steps:
24-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v3
2525

2626
- name: Set Node.js 16
27-
uses: actions/setup-node@v1
27+
uses: actions/setup-node@v3
2828
with:
2929
node-version: 16.x
30+
cache: npm
3031

3132
- name: Install dependencies
3233
run: npm ci
@@ -44,7 +45,7 @@ jobs:
4445
id: diff
4546

4647
# If index.js was different than expected, upload the expected version as an artifact
47-
- uses: actions/upload-artifact@v2
48+
- uses: actions/upload-artifact@v3
4849
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
4950
with:
5051
name: dist

.github/workflows/licensed.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
name: Check licenses
1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v3
1818
- run: npm ci
1919
- name: Install licensed
2020
run: |

.github/workflows/test-dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
dotnet-version: ['2.1', '2.2', '3.0', '3.1', '5.0']
2222
steps:
2323
- name: Checkout
24-
uses: actions/checkout@v2
24+
uses: actions/checkout@v3
2525
- name: Clear toolcache
2626
shell: pwsh
2727
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}

.github/workflows/workflow.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
2121
steps:
2222
- name: Checkout
23-
uses: actions/checkout@v2
23+
uses: actions/checkout@v3
2424
- name: Set Node.js 16
25-
uses: actions/setup-node@v1
25+
uses: actions/setup-node@v3
2626
with:
2727
node-version: 16.x
2828
cache: npm
@@ -42,7 +42,7 @@ jobs:
4242
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
4343
steps:
4444
- name: Checkout
45-
uses: actions/checkout@v2
45+
uses: actions/checkout@v3
4646
- name: Clear toolcache
4747
shell: pwsh
4848
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -65,7 +65,7 @@ jobs:
6565
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
6666
steps:
6767
- name: Checkout
68-
uses: actions/checkout@v2
68+
uses: actions/checkout@v3
6969
- name: Clear toolcache
7070
shell: pwsh
7171
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -98,7 +98,7 @@ jobs:
9898
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
9999
steps:
100100
- name: Checkout
101-
uses: actions/checkout@v2
101+
uses: actions/checkout@v3
102102
- name: Clear toolcache
103103
shell: pwsh
104104
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -123,7 +123,7 @@ jobs:
123123
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
124124
steps:
125125
- name: Checkout
126-
uses: actions/checkout@v2
126+
uses: actions/checkout@v3
127127
- name: Clear toolcache
128128
shell: pwsh
129129
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -147,7 +147,7 @@ jobs:
147147
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
148148
steps:
149149
- name: Checkout
150-
uses: actions/checkout@v2
150+
uses: actions/checkout@v3
151151
- name: Clear toolcache
152152
shell: pwsh
153153
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -178,7 +178,7 @@ jobs:
178178
http_proxy: http://squid-proxy:3128
179179
steps:
180180
- name: Checkout
181-
uses: actions/checkout@v2
181+
uses: actions/checkout@v3
182182
- name: Clear tool cache
183183
run: rm -rf "/usr/share/dotnet"
184184
- name: Install curl
@@ -202,7 +202,7 @@ jobs:
202202
no_proxy: github.com,dotnetcli.blob.core.windows.net,download.visualstudio.microsoft.com,api.nuget.org,dotnetcli.azureedge.net
203203
steps:
204204
- name: Checkout
205-
uses: actions/checkout@v2
205+
uses: actions/checkout@v3
206206
- name: Clear tool cache
207207
run: rm -rf "/usr/share/dotnet"
208208
- name: Setup dotnet 3.1.201

README.md

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# setup-dotnet
22

3-
<p align="left">
4-
<a href="https://github.com/actions/setup-dotnet"><img alt="GitHub Actions status" src="https://github.com/actions/setup-dotnet/workflows/Main%20workflow/badge.svg"></a>
5-
</p>
3+
[![GitHub Actions Status](https://github.com/actions/setup-dotnet/workflows/Main%20workflow/badge.svg)](https://github.com/actions/setup-dotnet)
64

75
This action sets up a [.NET CLI](https://github.com/dotnet/sdk) environment for use in actions by:
86

@@ -23,8 +21,8 @@ See [action.yml](action.yml)
2321
Basic:
2422
```yaml
2523
steps:
26-
- uses: actions/checkout@v2
27-
- uses: actions/setup-dotnet@v1
24+
- uses: actions/checkout@v3
25+
- uses: actions/setup-dotnet@v2
2826
with:
2927
dotnet-version: '3.1.x' # SDK Version to use; x will use the latest version of the 3.1 channel
3028
- run: dotnet build <my project>
@@ -34,9 +32,9 @@ Multiple versions:
3432

3533
```yml
3634
steps:
37-
- uses: actions/checkout@v2
35+
- uses: actions/checkout@v3
3836
- name: Setup dotnet
39-
uses: actions/setup-dotnet@v1
37+
uses: actions/setup-dotnet@v2
4038
with:
4139
dotnet-version: |
4240
3.1.x
@@ -46,8 +44,8 @@ steps:
4644
Preview version:
4745
```yml
4846
steps:
49-
- uses: actions/checkout@v2
50-
- uses: actions/setup-dotnet@v1
47+
- uses: actions/checkout@v3
48+
- uses: actions/setup-dotnet@v2
5149
with:
5250
dotnet-version: '6.0.x'
5351
include-prerelease: true
@@ -64,9 +62,9 @@ jobs:
6462
dotnet: [ '2.1.x', '3.1.x', '5.0.x' ]
6563
name: Dotnet ${{ matrix.dotnet }} sample
6664
steps:
67-
- uses: actions/checkout@v2
65+
- uses: actions/checkout@v3
6866
- name: Setup dotnet
69-
uses: actions/setup-dotnet@v1
67+
uses: actions/setup-dotnet@v2
7068
with:
7169
dotnet-version: ${{ matrix.dotnet }}
7270
- run: dotnet build <my project>
@@ -79,13 +77,13 @@ jobs:
7977
runs-on: ubuntu-latest
8078
name: Dotnet Side by Side testing sample
8179
steps:
82-
- uses: actions/checkout@v2
80+
- uses: actions/checkout@v3
8381
- name: Setup dotnet
84-
uses: actions/setup-dotnet@v1
82+
uses: actions/setup-dotnet@v2
8583
with:
8684
dotnet-version: '2.1.x'
8785
- name: Setup dotnet
88-
uses: actions/setup-dotnet@v1
86+
uses: actions/setup-dotnet@v2
8987
with:
9088
dotnet-version: '3.1.x'
9189
- run: dotnet build <my project>
@@ -95,9 +93,9 @@ jobs:
9593
Authentication for nuget feeds:
9694
```yaml
9795
steps:
98-
- uses: actions/checkout@v2
96+
- uses: actions/checkout@v3
9997
# Authenticates packages to push to GPR
100-
- uses: actions/setup-dotnet@v1
98+
- uses: actions/setup-dotnet@v2
10199
with:
102100
dotnet-version: '3.1.x' # SDK Version to use.
103101
source-url: https://nuget.pkg.github.com/<owner>/index.json
@@ -110,7 +108,7 @@ steps:
110108
run: dotnet nuget push <my project>/bin/Release/*.nupkg
111109
112110
# Authenticates packages to push to Azure Artifacts
113-
- uses: actions/setup-dotnet@v1
111+
- uses: actions/setup-dotnet@v2
114112
with:
115113
source-url: https://pkgs.dev.azure.com/<your-organization>/_packaging/<your-feed-name>/nuget/v3/index.json
116114
env:
@@ -120,7 +118,7 @@ steps:
120118
121119
# Authenticates packages to push to nuget.org.
122120
# It's only the way to push a package to nuget.org feed for macOS/Linux machines due to API key config store limitations.
123-
- uses: actions/setup-dotnet@v1
121+
- uses: actions/setup-dotnet@v2
124122
with:
125123
dotnet-version: 3.1.x
126124
- name: Publish the package to nuget.org
@@ -145,7 +143,7 @@ build:
145143
DOTNET_NOLOGO: true
146144
steps:
147145
- uses: actions/checkout@main
148-
- uses: actions/setup-dotnet@v1
146+
- uses: actions/setup-dotnet@v2
149147
with:
150148
dotnet-version: '3.1.x' # SDK Version to use.
151149
```

docs/contributors.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,15 @@ With any contribution please take time to consider how this can be tested to mai
2626
## Creating new version
2727

2828
Details on versioning can be found here: https://github.com/actions/toolkit/blob/main/docs/action-versioning.md
29-
Create a new release using the UI. Version format should be `v1.x.x`. Creating a new major version requires reaction from users and should be done only with breaking changes.
30-
Once the new release is created, the v1 tag needs to be updated as well.
29+
Create a new release using the UI. Version format should be `vX.Y.Z`. Creating a new major version requires reaction from users and should be done only with breaking changes.
30+
Once the new release is created, the vX tag needs to be updated as well.
3131
```
32-
git tag -fa v1 -m "Update v1 tag"
33-
git push origin v1 --force
32+
git tag -fa vX -m "Update vX tag"
33+
git push origin vX --force
3434
```
35+
36+
For example, if you're publishing v2:
37+
```
38+
git tag -fa v2 -m "Update v2 tag"
39+
git push origin v2 --force
40+
```

externals/install-dotnet.sh

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -637,11 +637,13 @@ get_specific_product_version() {
637637

638638
if machine_has "curl"
639639
then
640-
specific_product_version=$(curl -s --fail "${download_link}${feed_credential}" 2>&1)
641-
if [ $? = 0 ]; then
640+
if ! specific_product_version=$(curl -s --fail "${download_link}${feed_credential}" 2>&1); then
641+
continue
642+
else
642643
echo "${specific_product_version//[$'\t\r\n']}"
643644
return 0
644645
fi
646+
645647
elif machine_has "wget"
646648
then
647649
specific_product_version=$(wget -qO- "${download_link}${feed_credential}" 2>&1)
@@ -921,25 +923,24 @@ get_http_header_wget() {
921923
local remote_path="$1"
922924
local disable_feed_credential="$2"
923925
local wget_options="-q -S --spider --tries 5 "
924-
# Store options that aren't supported on all wget implementations separately.
925-
local wget_options_extra="--waitretry 2 --connect-timeout 15 "
926-
local wget_result=''
926+
927+
local wget_options_extra=''
928+
929+
# Test for options that aren't supported on all wget implementations.
930+
if [[ $(wget -h 2>&1 | grep -E 'waitretry|connect-timeout') ]]; then
931+
wget_options_extra="--waitretry 2 --connect-timeout 15 "
932+
else
933+
say "wget extra options are unavailable for this environment"
934+
fi
927935
928936
remote_path_with_credential="$remote_path"
929937
if [ "$disable_feed_credential" = false ]; then
930938
remote_path_with_credential+="$feed_credential"
931939
fi
932940
933941
wget $wget_options $wget_options_extra "$remote_path_with_credential" 2>&1
934-
wget_result=$?
935-
936-
if [[ $wget_result == 2 ]]; then
937-
# Parsing of the command has failed. Exclude potentially unrecognized options and retry.
938-
wget $wget_options "$remote_path_with_credential" 2>&1
939-
return $?
940-
fi
941942
942-
return $wget_result
943+
return $?
943944
}
944945
945946
# args:
@@ -1030,10 +1031,17 @@ downloadwget() {
10301031
# Append feed_credential as late as possible before calling wget to avoid logging feed_credential
10311032
local remote_path_with_credential="${remote_path}${feed_credential}"
10321033
local wget_options="--tries 20 "
1033-
# Store options that aren't supported on all wget implementations separately.
1034-
local wget_options_extra="--waitretry 2 --connect-timeout 15 "
1034+
1035+
local wget_options_extra=''
10351036
local wget_result=''
10361037
1038+
# Test for options that aren't supported on all wget implementations.
1039+
if [[ $(wget -h 2>&1 | grep -E 'waitretry|connect-timeout') ]]; then
1040+
wget_options_extra="--waitretry 2 --connect-timeout 15 "
1041+
else
1042+
say "wget extra options are unavailable for this environment"
1043+
fi
1044+
10371045
if [ -z "$out_path" ]; then
10381046
wget -q $wget_options $wget_options_extra -O - "$remote_path_with_credential" 2>&1
10391047
wget_result=$?
@@ -1042,17 +1050,6 @@ downloadwget() {
10421050
wget_result=$?
10431051
fi
10441052
1045-
if [[ $wget_result == 2 ]]; then
1046-
# Parsing of the command has failed. Exclude potentially unrecognized options and retry.
1047-
if [ -z "$out_path" ]; then
1048-
wget -q $wget_options -O - "$remote_path_with_credential" 2>&1
1049-
wget_result=$?
1050-
else
1051-
wget $wget_options -O "$out_path" "$remote_path_with_credential" 2>&1
1052-
wget_result=$?
1053-
fi
1054-
fi
1055-
10561053
if [[ $wget_result != 0 ]]; then
10571054
local disable_feed_credential=false
10581055
local response=$(get_http_header_wget $remote_path $disable_feed_credential)
@@ -1652,4 +1649,4 @@ fi
16521649
16531650
say "Note that the script does not resolve dependencies during installation."
16541651
say "To check the list of dependencies, go to https://docs.microsoft.com/dotnet/core/install, select your operating system and check the \"Dependencies\" section."
1655-
say "Installation finished successfully."
1652+
say "Installation finished successfully."

0 commit comments

Comments
 (0)