Skip to content

Commit 7d67a7b

Browse files
authored
Merge pull request #3 from InCerryGit/add_gitaction
update target frameworks to support .NET 7.0, 8.0, 9.0, and 10.0; adj…
2 parents fb02ca3 + 8fc4a00 commit 7d67a7b

12 files changed

Lines changed: 436 additions & 63 deletions

File tree

.github/workflows/build.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@ jobs:
1616
os: [ windows-latest ]
1717

1818
steps:
19-
- uses: actions/checkout@v2
20-
- name: Setup .NET SDK
19+
- uses: actions/checkout@v4
20+
- name: Setup .NET SDK 6.0.x - 10.0.x
2121
uses: actions/setup-dotnet@v3
2222
with:
2323
dotnet-version: |
24+
10.0.x
25+
9.0.x
26+
8.0.x
27+
7.0.x
2428
6.0.x
2529
2630
- name: Show dotnet Version
@@ -30,4 +34,4 @@ jobs:
3034
3135
- name: Build with dotnet
3236
run: |
33-
dotnet build --configuration Release D:\a\Dispose.Scope\Dispose.Scope\DisposeScope.sln
37+
dotnet build --configuration Release DisposeScope.sln -p:CheckEolTargetFramework=false

.github/workflows/buildandtest.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@ jobs:
1616
os: [ ubuntu-latest ]
1717

1818
steps:
19-
- uses: actions/checkout@v2
20-
- name: Setup .NET SDK
19+
- uses: actions/checkout@v4
20+
- name: Setup .NET SDK 6.0.x - 10.0.x
2121
uses: actions/setup-dotnet@v3
2222
with:
2323
dotnet-version: |
24+
10.0.x
25+
9.0.x
26+
8.0.x
27+
7.0.x
2428
6.0.x
2529
2630
- name: Show dotnet Version
@@ -30,8 +34,8 @@ jobs:
3034
3135
- name: Build with dotnet
3236
run: |
33-
dotnet build --configuration Release /home/runner/work/Dispose.Scope/Dispose.Scope/DisposeScope.sln
37+
dotnet build --configuration Release DisposeScope.sln -p:CheckEolTargetFramework=false
3438
3539
- name: Run tests
3640
run: |
37-
dotnet test /home/runner/work/Dispose.Scope/Dispose.Scope/tests/Dispose.Scope.Tests/Dispose.Scope.Tests.csproj
41+
dotnet test tests/Dispose.Scope.Tests/Dispose.Scope.Tests.csproj -p:CheckEolTargetFramework=false

.github/workflows/release_stable.yml

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,27 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v1
16-
- name: Setup .NET SDK
15+
- uses: actions/checkout@v4
16+
- name: Setup .NET SDK 6.0.x - 10.0.x
1717
uses: actions/setup-dotnet@v3
1818
with:
1919
dotnet-version: |
20+
10.0.x
21+
9.0.x
22+
8.0.x
23+
7.0.x
2024
6.0.x
2125
- name: Build with dotnet
22-
run: dotnet build --configuration Release /home/runner/work/Dispose.Scope/Dispose.Scope/DisposeScope.sln
26+
run: dotnet build --configuration Release DisposeScope.sln -p:CheckEolTargetFramework=false
2327
- name: Pack with dotnet
2428
env:
2529
VERSION: ${{ github.ref_name }}
26-
run: dotnet pack /home/runner/work/Dispose.Scope/Dispose.Scope/DisposeScope.sln --version-suffix $VERSION -o /home/runner/work/nugetpkgs -c Release --no-build
30+
run: dotnet pack DisposeScope.sln --version-suffix $VERSION -o ./nugetpkgs -c Release --no-build
2731
- name: Upload artifact
28-
uses: actions/upload-artifact@v1
32+
uses: actions/upload-artifact@v4
2933
with:
3034
name: nugetpkgs
31-
path: /home/runner/work/nugetpkgs
35+
path: ./nugetpkgs
3236

3337
release_nuget:
3438
name: Release to Nuget
@@ -37,14 +41,39 @@ jobs:
3741

3842
steps:
3943
- name: Download build artifacts
40-
uses: actions/download-artifact@v1
44+
uses: actions/download-artifact@v4
4145
with:
4246
name: nugetpkgs
43-
- name: list nugetpkgs
44-
run: ls nugetpkgs
47+
path: .
48+
- name: Debug downloaded artifacts
49+
shell: bash
50+
run: |
51+
set -e
52+
echo "PWD: $(pwd)"
53+
echo "Top-level:"
54+
ls -la
55+
echo "NUPKG files:"
56+
ls -la *.nupkg || true
4557
- name: Release
58+
shell: bash
4659
run: |
47-
for file in nugetpkgs/*.nupkg
48-
do
49-
dotnet nuget push $file -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate -s https://www.nuget.org/api/v2/package
60+
set -e
61+
shopt -s nullglob
62+
63+
# All non-library projects should have IsPackable=false, so we can push everything we packed.
64+
files=( *.nupkg )
65+
if [ ${#files[@]} -eq 0 ]; then
66+
echo "No .nupkg files found in workspace root."
67+
exit 1
68+
fi
69+
70+
for file in "${files[@]}"; do
71+
case "$file" in
72+
*.snupkg|*symbols*.nupkg)
73+
echo "Skipping: $file"
74+
continue
75+
;;
76+
esac
77+
echo "Pushing: $file"
78+
dotnet nuget push "$file" -k "${{ secrets.NUGET_API_KEY }}" --skip-duplicate -s https://www.nuget.org/api/v2/package
5079
done

.github/workflows/release_unstable.yml

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,27 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v1
17-
- name: Setup .NET SDK
16+
- uses: actions/checkout@v4
17+
- name: Setup .NET SDK 6.0.x - 10.0.x
1818
uses: actions/setup-dotnet@v3
1919
with:
2020
dotnet-version: |
21+
10.0.x
22+
9.0.x
23+
8.0.x
24+
7.0.x
2125
6.0.x
2226
- name: Build with dotnet
23-
run: dotnet build --configuration Release /home/runner/work/Dispose.Scope/Dispose.Scope/DisposeScope.sln
27+
run: dotnet build --configuration Release DisposeScope.sln -p:CheckEolTargetFramework=false
2428
- name: Pack with dotnet
2529
env:
2630
VERSION: ${{ github.ref_name }}
27-
run: dotnet pack /home/runner/work/Dispose.Scope/Dispose.Scope/DisposeScope.sln --version-suffix $VERSION -o /home/runner/work/nugetpkgs -c Release --no-build
31+
run: dotnet pack DisposeScope.sln --version-suffix $VERSION -o ./nugetpkgs -c Release --no-build
2832
- name: Upload artifact
29-
uses: actions/upload-artifact@v1
33+
uses: actions/upload-artifact@v4
3034
with:
3135
name: nugetpkgs
32-
path: /home/runner/work/nugetpkgs
36+
path: ./nugetpkgs
3337

3438
release_nuget:
3539
name: Release to Nuget
@@ -38,14 +42,39 @@ jobs:
3842

3943
steps:
4044
- name: Download build artifacts
41-
uses: actions/download-artifact@v1
45+
uses: actions/download-artifact@v4
4246
with:
4347
name: nugetpkgs
44-
- name: list nugetpkgs
45-
run: ls nugetpkgs
48+
path: .
49+
- name: Debug downloaded artifacts
50+
shell: bash
51+
run: |
52+
set -e
53+
echo "PWD: $(pwd)"
54+
echo "Top-level:"
55+
ls -la
56+
echo "NUPKG files:"
57+
ls -la *.nupkg || true
4658
- name: Release
59+
shell: bash
4760
run: |
48-
for file in nugetpkgs/*.nupkg
49-
do
50-
dotnet nuget push $file -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate -s https://www.nuget.org/api/v2/package
51-
done
61+
set -e
62+
shopt -s nullglob
63+
64+
# All non-library projects should have IsPackable=false, so we can push everything we packed.
65+
files=( *.nupkg )
66+
if [ ${#files[@]} -eq 0 ]; then
67+
echo "No .nupkg files found in workspace root."
68+
exit 1
69+
fi
70+
71+
for file in "${files[@]}"; do
72+
case "$file" in
73+
*.snupkg|*symbols*.nupkg)
74+
echo "Skipping: $file"
75+
continue
76+
;;
77+
esac
78+
echo "Pushing: $file"
79+
dotnet nuget push "$file" -k "${{ secrets.NUGET_API_KEY }}" --skip-duplicate -s https://www.nuget.org/api/v2/package
80+
done

0 commit comments

Comments
 (0)