Skip to content

Commit 4c51854

Browse files
authored
Merge pull request #358 from codebude/feature/decouple-xaml-code-add-net6_0
Feature/decouple xaml code add net6 0
2 parents 385eb62 + 8c3905a commit 4c51854

35 files changed

+610
-216
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ Thanks for submitting a pull request! Please provide enough information so that
44
A similar PR may already be submitted!
55
Please search among the Pull request before creating one: https://github.com/codebude/QRCoder/pulls?utf8=%E2%9C%93&q=
66
7-
For more information, see the `CONTRIBUTING` guide.
7+
For more information, see the `CONTRIBUTING` guide.-->
88

99

10-
**Summary**
11-
10+
## Summary
1211
<!-- Summarize your pull request in a couple of words -->
1312

1413
This PR fixes/implements the following **bugs/features**:
@@ -20,16 +19,12 @@ This PR fixes/implements the following **bugs/features**:
2019
* [ ] Breaking changes
2120

2221
<!-- You can skip this if you're fixing a typo or other minor things -->
23-
24-
What existing problem does the pull request solve?
25-
22+
### What existing problem does the pull request solve?**
2623
<!-- Example: When "Adding a function to do X", explain why it is necessary to have a way to do X. -->
2724

28-
**Test plan**
29-
30-
Demonstrate that your code is solid. If possible add a short test case/test steps.
31-
32-
**Closing issues**
25+
## Test plan
26+
<!-- Demonstrate that your code is solid. If possible add a short test case/test steps. -->
3327

28+
## Closing issues
3429
<!-- Put `closes #XXXX` (XXXX=issue number) in your comment to auto-close the issue that your PR fixes (if such). -->
3530
Fixes #

.github/workflows/wf-build-release-ci.yml

Lines changed: 63 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,23 @@ on:
66
workflow_dispatch:
77
jobs:
88
build:
9-
runs-on: windows-2022
9+
runs-on: windows-2019
1010
env:
1111
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
1212
steps:
1313
- uses: actions/checkout@v1
1414
name: Checkout Code
15-
16-
- name: Setup MSBuild Ppth
15+
16+
- name: Install additional .NET SDKs
17+
uses: actions/setup-dotnet@v1
18+
with:
19+
dotnet-version: |
20+
1.0.x
21+
2.0.x
22+
5.0.x
23+
6.0.x
24+
25+
- name: Setup MSBuild Path
1726
uses: microsoft/setup-msbuild@v1
1827

1928
- name: Setup NuGet
@@ -23,7 +32,7 @@ jobs:
2332
run: nuget restore QRCoder.sln
2433

2534
- name: Build library
26-
run: msbuild QRCoder.sln /p:Configuration=Release /nr:false /t:Rebuild
35+
run: msbuild QRCoder.sln /p:Configuration=Release /p:NoWarn="1182" /p:NoWarn="1701" /nr:false /t:Rebuild
2736

2837
- name: Upload artifacts
2938
uses: actions/[email protected]
@@ -33,64 +42,86 @@ jobs:
3342

3443
test:
3544
needs: build
36-
runs-on: windows-2022
45+
runs-on: windows-2019
3746
steps:
3847
- name: Download artifacts
3948
uses: actions/[email protected]
4049
with:
4150
name: Compiled project
4251
path: D:\a\qrcoder\qrcoder
52+
53+
- name: Install additional .NET SDKs
54+
uses: actions/setup-dotnet@v1
55+
with:
56+
dotnet-version: |
57+
1.0.x
58+
2.0.x
59+
5.0.x
60+
6.0.x
61+
4362
- name: Run test .NET 3.5
44-
run: dotnet test -c Release -f net35 --nologo --no-build # No coverage for NET3.5 because of bug in combination with Coverlet+Stron naming
63+
run: dotnet test -c Release -f net35 --nologo --no-build # No coverage for NET3.5 because of bug in combination with Coverlet+Stronh naming
64+
4565
- name: Run test .NET 4.52
46-
run: dotnet test -c Release -f net452 --nologo --no-build # No coverage for NET4.5 because of bug in combination with Coverlet+Stron naming
47-
- name: Run test .NET Core 1.3
48-
run: dotnet test -c Release -f netcoreapp1.3 --nologo /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
66+
run: dotnet test -c Release -f net452 --nologo --no-build # No coverage for NET4.5 because of bug in combination with Coverlet+Strong naming
67+
68+
- name: Run test .NET Core 1.1
69+
run: dotnet test -c Release -f netcoreapp1.1 --nologo # No coverage for .NETCORE 1.1 because Coverlet doesn't support it https://github.com/coverlet-coverage/coverlet/issues/466
70+
4971
- name: Run test .NET Core 2.0
5072
run: dotnet test -c Release -f netcoreapp2.0 --nologo /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
73+
5174
- name: Run test .NET 5.0
5275
run: dotnet test -c Release -f net5.0 --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
76+
5377
- name: Run test .NET 5.0 Windows
5478
run: dotnet test -c Release -f net5.0-windows --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
79+
5580
- name: Run test .NET 6.0
5681
run: dotnet test -c Release -f net6.0 --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
82+
5783
- name: Run test .NET 6.0 Windows
5884
run: dotnet test -c Release -f net6.0-windows --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
85+
5986
- name: Codecov update netcoreapp2.0
6087
uses: codecov/codecov-action@v2
6188
with:
6289
token: ${{ secrets.CODECOV_TOKEN }}
6390
files: ./QRCoderTests/coverage.netcoreapp2.0.opencover.xml
6491
flags: netcoreapp2.0
92+
6593
- name: Codecov update net5.0
6694
uses: codecov/codecov-action@v2
6795
with:
6896
token: ${{ secrets.CODECOV_TOKEN }}
6997
files: ./QRCoderTests/coverage.net5.0.opencover.xml
7098
flags: net5.0
99+
71100
- name: Codecov update net5.0-windows
72101
uses: codecov/codecov-action@v2
73102
with:
74103
token: ${{ secrets.CODECOV_TOKEN }}
75104
files: ./QRCoderTests/coverage.net5.0-windows.opencover.xml
76105
flags: net5.0-windows
106+
77107
- name: Codecov update net6.0
78108
uses: codecov/codecov-action@v2
79109
with:
80110
token: ${{ secrets.CODECOV_TOKEN }}
81111
files: ./QRCoderTests/coverage.net5.0.opencover.xml
82-
flags: net5.0
112+
flags: net6.0
113+
83114
- name: Codecov update net6.0-windows
84115
uses: codecov/codecov-action@v2
85116
with:
86117
token: ${{ secrets.CODECOV_TOKEN }}
87118
files: ./QRCoderTests/coverage.net5.0-windows.opencover.xml
88-
flags: net5.0-windows
119+
flags: net6.0-windows
89120

90121

91122
pack-push-ci:
92123
needs: test
93-
runs-on: windows-2022
124+
runs-on: windows-2019
94125
env:
95126
GH_PKG_SEC: ${{ secrets.GH_PKG_REPO }}
96127
steps:
@@ -99,32 +130,51 @@ jobs:
99130
with:
100131
name: Compiled project
101132
path: D:\a\qrcoder\qrcoder
133+
134+
- name: Install additional .NET SDKs
135+
uses: actions/setup-dotnet@v1
136+
with:
137+
dotnet-version: |
138+
1.0.x
139+
2.0.x
140+
5.0.x
141+
6.0.x
142+
102143
- name: Restore dependencies
103144
run: dotnet restore
145+
104146
- name: Get assembly version QRCoder
105147
run: echo "ASSEM_VER=$([Reflection.Assembly]::Loadfile( $(-join($pwd,"\QRCoder\bin\Release\net40\QRCoder.dll"))).GetName().version.ToString())" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
148+
106149
- name: Clean assembly version QRCoder
107150
run: echo "ASSEM_VER_SHT=$($env:ASSEM_VER.substring(0, $env:ASSEM_VER.lastIndexOf(".")))" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
151+
108152
- name: Calculate ci suffix QRCoder
109153
run: echo "CI_TAG=-ci-$([datetime]::now.tostring("yyyyMMddHHmmss"))" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
154+
110155
- name: Get assembly version QRCoder.Xaml
111156
run: echo "ASSEM_VER_XAML=$([Reflection.Assembly]::Loadfile( $(-join($pwd,"\QRCoder.Xaml\bin\Release\net40\QRCoder.Xaml.dll"))).GetName().version.ToString())" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
157+
112158
- name: Clean assembly version QRCoder.Xaml
113159
run: echo "ASSEM_VER_SHT_XAML=$($env:ASSEM_VER_XAML.substring(0, $env:ASSEM_VER_XAML.lastIndexOf(".")))" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
160+
114161
- name: Calculate ci suffix QRCoder.Xaml
115162
run: echo "CI_TAG_XAML=-ci-$([datetime]::now.tostring("yyyyMMddHHmmss"))" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
163+
116164
- name: Build QRCoder NuGet package
117165
run: dotnet pack QRCoder\QRCoder.csproj -c Release --no-build /p:PackageVersion="$env:ASSEM_VER_SHT$env:CI_TAG" /p:PackageReleaseNotes="- This is an automatic CI build ($env:CI_TAG)`n- Please don't use it in productive environments!"
166+
118167
- name: Build QRCoder.Xaml NuGet package
119168
run: dotnet pack QRCoder.Xaml\QRCoder.Xaml.csproj -c Release --no-build /p:PackageVersion="$env:ASSEM_VER_SHT_XAML$env:CI_TAG_XAML" /p:PackageReleaseNotes="- This is an automatic CI build ($env:CI_TAG_XAML)`n- Please don't use it in productive environments!"
169+
120170
- name: Publish QRCoder and QRCoder.Xaml to Github packages
121171
run: dotnet nuget push "**/*.nupkg" --no-symbols --skip-duplicate --api-key $env:GH_PKG_SEC --source https://nuget.pkg.github.com/codebude/index.json
122172

123173

124174
clean:
125175
needs: [build, test, pack-push-ci]
126176
if: always()
127-
runs-on: windows-2022
177+
runs-on: windows-2019
128178
steps:
129179
- name: Delete artifacts
130180
uses: GeekyEggo/[email protected]

.github/workflows/wf-build-release.yml

Lines changed: 60 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,23 @@ on:
77
required: true
88
jobs:
99
build:
10-
runs-on: windows-2022
10+
runs-on: windows-2019
1111
env:
1212
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
1313
steps:
1414
- uses: actions/checkout@v1
1515
name: Checkout Code
16+
17+
- name: Install additional .NET SDKs
18+
uses: actions/setup-dotnet@v1
19+
with:
20+
dotnet-version: |
21+
1.0.x
22+
2.0.x
23+
5.0.x
24+
6.0.x
1625
17-
- name: Setup MSBuild Ppth
26+
- name: Setup MSBuild Path
1827
uses: microsoft/setup-msbuild@v1
1928

2029
- name: Setup NuGet
@@ -24,7 +33,7 @@ jobs:
2433
run: nuget restore QRCoder.sln
2534

2635
- name: Build library
27-
run: msbuild QRCoder.sln /p:Configuration=Release /nr:false /t:Rebuild
36+
run: msbuild QRCoder.sln /p:Configuration=Release /p:NoWarn="1182" /p:NoWarn="1701" /nr:false /t:Rebuild
2837

2938
- name: Upload artifacts
3039
uses: actions/[email protected]
@@ -34,63 +43,85 @@ jobs:
3443

3544
test:
3645
needs: build
37-
runs-on: windows-2022
46+
runs-on: windows-2019
3847
steps:
3948
- name: Download artifacts
4049
uses: actions/[email protected]
4150
with:
4251
name: Compiled project
4352
path: D:\a\qrcoder\qrcoder
53+
54+
- name: Install additional .NET SDKs
55+
uses: actions/setup-dotnet@v1
56+
with:
57+
dotnet-version: |
58+
1.0.x
59+
2.0.x
60+
5.0.x
61+
6.0.x
62+
4463
- name: Run test .NET 3.5
45-
run: dotnet test -c Release -f net35 --nologo --no-build # No coverage for NET3.5 because of bug in combination with Coverlet+Stron naming
64+
run: dotnet test -c Release -f net35 --nologo --no-build # No coverage for NET3.5 because of bug in combination with Coverlet+Stronh naming
65+
4666
- name: Run test .NET 4.52
47-
run: dotnet test -c Release -f net452 --nologo --no-build # No coverage for NET4.5 because of bug in combination with Coverlet+Stron naming
48-
- name: Run test .NET Core 1.3
49-
run: dotnet test -c Release -f netcoreapp1.3 --nologo /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
67+
run: dotnet test -c Release -f net452 --nologo --no-build # No coverage for NET4.5 because of bug in combination with Coverlet+Strong naming
68+
69+
- name: Run test .NET Core 1.1
70+
run: dotnet test -c Release -f netcoreapp1.1 --nologo # No coverage for .NETCORE 1.1 because Coverlet doesn't support it https://github.com/coverlet-coverage/coverlet/issues/466
71+
5072
- name: Run test .NET Core 2.0
5173
run: dotnet test -c Release -f netcoreapp2.0 --nologo /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
74+
5275
- name: Run test .NET 5.0
5376
run: dotnet test -c Release -f net5.0 --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
77+
5478
- name: Run test .NET 5.0 Windows
5579
run: dotnet test -c Release -f net5.0-windows --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
80+
5681
- name: Run test .NET 6.0
5782
run: dotnet test -c Release -f net6.0 --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
83+
5884
- name: Run test .NET 6.0 Windows
5985
run: dotnet test -c Release -f net6.0-windows --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
86+
6087
- name: Codecov update netcoreapp2.0
6188
uses: codecov/codecov-action@v2
6289
with:
6390
token: ${{ secrets.CODECOV_TOKEN }}
6491
files: ./QRCoderTests/coverage.netcoreapp2.0.opencover.xml
6592
flags: netcoreapp2.0
93+
6694
- name: Codecov update net5.0
6795
uses: codecov/codecov-action@v2
6896
with:
6997
token: ${{ secrets.CODECOV_TOKEN }}
7098
files: ./QRCoderTests/coverage.net5.0.opencover.xml
7199
flags: net5.0
100+
72101
- name: Codecov update net5.0-windows
73102
uses: codecov/codecov-action@v2
74103
with:
75104
token: ${{ secrets.CODECOV_TOKEN }}
76105
files: ./QRCoderTests/coverage.net5.0-windows.opencover.xml
77106
flags: net5.0-windows
107+
78108
- name: Codecov update net6.0
79109
uses: codecov/codecov-action@v2
80110
with:
81111
token: ${{ secrets.CODECOV_TOKEN }}
82112
files: ./QRCoderTests/coverage.net5.0.opencover.xml
83-
flags: net5.0
113+
flags: net6.0
114+
84115
- name: Codecov update net6.0-windows
85116
uses: codecov/codecov-action@v2
86117
with:
87118
token: ${{ secrets.CODECOV_TOKEN }}
88119
files: ./QRCoderTests/coverage.net5.0-windows.opencover.xml
89-
flags: net5.0-windows
120+
flags: net6.0-windows
90121

91122
pack-push-release:
92123
needs: test
93-
runs-on: windows-2022
124+
runs-on: windows-2019
94125
env:
95126
GH_PKG_SEC: ${{ secrets.GH_PKG_REPO }}
96127
steps:
@@ -99,28 +130,45 @@ jobs:
99130
with:
100131
name: Compiled project
101132
path: D:\a\qrcoder\qrcoder
133+
134+
- name: Install additional .NET SDKs
135+
uses: actions/setup-dotnet@v1
136+
with:
137+
dotnet-version: |
138+
1.0.x
139+
2.0.x
140+
5.0.x
141+
6.0.x
142+
102143
- name: Restore dependencies
103144
run: dotnet restore
145+
104146
- name: Get assembly version QRCoder
105147
run: echo "ASSEM_VER=$([Reflection.Assembly]::Loadfile( $(-join($pwd,"\QRCoder\bin\Release\net40\QRCoder.dll"))).GetName().version.ToString())" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
148+
106149
- name: Clean assembly version QRCoder
107150
run: echo "ASSEM_VER_SHT=$($env:ASSEM_VER.substring(0, $env:ASSEM_VER.lastIndexOf(".")))" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
151+
108152
- name: Get assembly version QRCoder.Xaml
109153
run: echo "ASSEM_VER_XAML=$([Reflection.Assembly]::Loadfile( $(-join($pwd,"\QRCoder.Xaml\bin\Release\net40\QRCoder.Xaml.dll"))).GetName().version.ToString())" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
154+
110155
- name: Clean assembly version QRCoder.Xaml
111156
run: echo "ASSEM_VER_SHT_XAML=$($env:ASSEM_VER_XAML.substring(0, $env:ASSEM_VER_XAML.lastIndexOf(".")))" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
157+
112158
- name: Build QRCoder NuGet package
113159
run: dotnet pack QRCoder\QRCoder.csproj -c Release --no-build /p:PackageVersion="$env:ASSEM_VER_SHT" /p:PackageReleaseNotes="${{ github.event.inputs.releaseNotes }}"
160+
114161
- name: Build QRCoder.Xaml NuGet package
115162
run: dotnet pack QRCoder.Xaml\QRCoder.Xaml.csproj -c Release --no-build /p:PackageVersion="$env:ASSEM_VER_SHT_XAML" /p:PackageReleaseNotes="${{ github.event.inputs.releaseNotes }}"
163+
116164
- name: Publish QRCoder and QRCoder.Xaml to Github packages
117165
run: dotnet nuget push "**/*.nupkg" --no-symbols --skip-duplicate --api-key $env:GH_PKG_SEC --source https://nuget.pkg.github.com/codebude/index.json
118166

119167

120168
clean:
121169
needs: [build, test, pack-push-release]
122170
if: always()
123-
runs-on: windows-2022
171+
runs-on: windows-2019
124172
steps:
125173
- name: Delete artifacts
126174
uses: GeekyEggo/[email protected]

0 commit comments

Comments
 (0)