Skip to content

Commit 8f4b644

Browse files
authored
Use major version tags in README and workflows (#2)
1 parent f02ad41 commit 8f4b644

File tree

6 files changed

+57
-10
lines changed

6 files changed

+57
-10
lines changed

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@
7070
*.pyo binary export-ignore
7171
*.pyd binary
7272

73+
### Linguist exclusions ############################################################################
74+
75+
test/* linguist-vendored
76+
7377
### Exclude files from exporting ###################################################################
7478

7579
.gitattributes export-ignore

.github/workflows/ci.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ jobs:
2121
platform: [ubuntu-latest, macos-latest, windows-latest]
2222
steps:
2323
- name: Checkout
24-
uses: actions/[email protected]
24+
uses: actions/checkout@v3
25+
26+
- name: Remove all preinstalled .NET SDKs
27+
shell: bash
28+
run: |
29+
"$GITHUB_WORKSPACE/test/cleanup.sh"
2530
2631
- name: 'TEST: Set up specific .NET SDK version'
2732
id: setup-specific
@@ -43,7 +48,7 @@ jobs:
4348
- name: Clean up
4449
shell: bash
4550
run: |
46-
rm -rf "$DOTNET_ROOT"
51+
"$GITHUB_WORKSPACE/test/cleanup.sh"
4752
4853
- name: 'TEST: Set up multiple .NET SDK versions'
4954
id: setup-multiple
@@ -68,7 +73,7 @@ jobs:
6873
- name: Clean up
6974
shell: bash
7075
run: |
71-
rm -rf "$DOTNET_ROOT"
76+
"$GITHUB_WORKSPACE/test/cleanup.sh"
7277
7378
- name: 'Create "global.json"'
7479
shell: bash
@@ -99,7 +104,7 @@ jobs:
99104
- name: Clean up
100105
shell: bash
101106
run: |
102-
rm -rf "$DOTNET_ROOT"
107+
"$GITHUB_WORKSPACE/test/cleanup.sh"
103108
104109
- name: 'TEST: Read .NET SDK version from "global.json" and input'
105110
id: setup-global-json-extra
@@ -123,4 +128,4 @@ jobs:
123128
- name: Clean up
124129
shell: bash
125130
run: |
126-
rm -rf "$DOTNET_ROOT"
131+
"$GITHUB_WORKSPACE/test/cleanup.sh"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Update Floating Version Tags
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
update-semver:
10+
name: Update Tags
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Update Semver
14+
uses: zyactions/update-semver@v1

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ A GitHub Action to set up a specific version of the .NET SDK in a workflow run.
2626
```yaml
2727
steps:
2828
- name: .NET Setup
29-
uses: zyactions/dotnet-setup@master
29+
uses: zyactions/dotnet-setup@v1
3030
with:
3131
dotnet-version: '7.0.0'
3232
```
@@ -36,7 +36,7 @@ steps:
3636
```yaml
3737
steps:
3838
- name: .NET Setup
39-
uses: zyactions/dotnet-setup@master
39+
uses: zyactions/dotnet-setup@v1
4040
with:
4141
dotnet-version: |
4242
7.0.x
@@ -48,7 +48,7 @@ steps:
4848
```yaml
4949
steps:
5050
- name: .NET Setup
51-
uses: zyactions/dotnet-setup@master
51+
uses: zyactions/dotnet-setup@v1
5252
with:
5353
global-json-file: ./global.json
5454
```
@@ -119,7 +119,7 @@ Versions follow the [semantic versioning scheme][semver].
119119
[dotnet-sdk]: https://github.com/dotnet/sdk
120120
[job-runs-on]: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
121121
[problem-matchers]: https://github.com/actions/runner/blob/main/docs/adrs/0276-problem-matchers.md
122-
[semver]:https://semver.org
122+
[semver]: https://semver.org
123123
[shield-license-mit]: https://img.shields.io/badge/License-MIT-blue.svg
124124
[shield-ci]: https://github.com/zyactions/dotnet-setup/actions/workflows/ci.yml/badge.svg
125125
[shield-platform-ubuntu]: https://img.shields.io/badge/Ubuntu-E95420?logo=ubuntu\&logoColor=white

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ runs:
4949
steps:
5050
- name: Setup .NET
5151
id: setup
52-
uses: actions/setup-dotnet@v3.0.3
52+
uses: actions/setup-dotnet@v3
5353
with:
5454
dotnet-version: ${{ inputs.dotnet-version }}
5555
dotnet-quality: ${{ inputs.dotnet-quality }}

test/cleanup.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
3+
function try_rename () {
4+
temp=$(mktemp --dry-run XXXXXXXX)
5+
{ mv "$1" "$1_$temp" || :; } > /dev/null 2>&1
6+
}
7+
8+
if [[ -n "$DOTNET_ROOT" ]]; then
9+
try_rename "$DOTNET_ROOT"
10+
fi
11+
12+
if [[ "$RUNNER_OS" == "Windows" ]]; then
13+
if [[ -n "$PROGRAMFILES" ]]; then
14+
try_rename "$PROGRAMFILES\dotnet"
15+
fi
16+
17+
if [[ -n "$LOCALAPPDATA" ]]; then
18+
try_rename "$LOCALAPPDATA\Microsoft\dotnet"
19+
fi
20+
else
21+
try_rename "~/.dotnet"
22+
try_rename "/usr/share/dotnet"
23+
try_rename "/usr/local/share/dotnet"
24+
fi

0 commit comments

Comments
 (0)