Skip to content

Commit d29ce69

Browse files
authored
Merge branch 'master' into fast_bitmap
2 parents da5c360 + 4a10c16 commit d29ce69

File tree

186 files changed

+4670
-2998
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+4670
-2998
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,4 +263,4 @@ dotnet_diagnostic.IDE0005.severity = warning
263263
# Enforce formatting https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/formatting-rules#rule-id-ide0055-fix-formatting
264264
dotnet_diagnostic.IDE0055.severity = error
265265
dotnet_diagnostic.IDE1006.severity = error
266-
dotnet_diagnostic.IDE0022.severity = error
266+
dotnet_diagnostic.IDE0022.severity = none

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

Lines changed: 22 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- master
7-
workflow_dispatch:
87

98
concurrency:
109
group: ${{ github.workflow }}-${{ github.ref }}
@@ -16,11 +15,11 @@ jobs:
1615
env:
1716
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
1817
steps:
19-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@v5
2019
name: Checkout Code
2120

2221
- name: Install additional .NET SDKs
23-
uses: actions/setup-dotnet@v4
22+
uses: actions/setup-dotnet@v5
2423
with:
2524
dotnet-version: |
2625
2.1.x
@@ -39,15 +38,7 @@ jobs:
3938
name: coverage-files
4039
path: QRCoderTests/coverage.*.xml
4140
retention-days: 1
42-
43-
upload-coverage:
44-
needs: test
45-
runs-on: ubuntu-latest
46-
steps:
47-
- name: Download coverage files
48-
uses: actions/download-artifact@v4
49-
with:
50-
name: coverage-files
41+
overwrite: true
5142

5243
- name: Upload to Codecov
5344
uses: codecov/codecov-action@v4
@@ -70,53 +61,37 @@ jobs:
7061
working-directory: QRCoderTrimAnalysis
7162
run: dotnet publish -c Release -o bin/publish
7263

64+
- name: Build solution
65+
run: dotnet build -c Release
66+
7367
- name: Run API approval tests
7468
working-directory: QRCoderApiTests
7569
run: dotnet test -c Release --nologo
7670

7771
pack-push-ci:
78-
needs: [test, additional-tests, upload-coverage]
72+
needs: [test, additional-tests]
7973
runs-on: windows-latest
80-
env:
81-
GH_PKG_SEC: ${{ secrets.GITHUB_TOKEN }}
8274
steps:
83-
- uses: actions/checkout@v4
75+
- uses: actions/checkout@v5
8476
name: Checkout Code
8577

8678
- name: Install .NET SDK
87-
uses: actions/setup-dotnet@v4
79+
uses: actions/setup-dotnet@v5
8880
with:
8981
dotnet-version: 8.0.x
82+
source-url: https://nuget.pkg.github.com/Shane32/index.json
83+
env:
84+
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
9085

91-
- name: Restore dependencies
92-
run: dotnet restore
86+
- name: Build NuGet packages
87+
shell: bash
88+
run: dotnet pack -c Release -p:VersionSuffix=$GITHUB_RUN_NUMBER -o out
9389

94-
- name: Build library
95-
run: dotnet build -c Release --no-restore
96-
97-
- name: Get assembly version QRCoder
98-
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
99-
100-
- name: Clean assembly version QRCoder
101-
run: echo "ASSEM_VER_SHT=$($env:ASSEM_VER.substring(0, $env:ASSEM_VER.lastIndexOf(".")))" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
102-
103-
- name: Calculate ci suffix QRCoder
104-
run: echo "CI_TAG=-ci-$([datetime]::now.tostring("yyyyMMddHHmmss"))" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
105-
106-
- name: Get assembly version QRCoder.Xaml
107-
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
108-
109-
- name: Clean assembly version QRCoder.Xaml
110-
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
111-
112-
- name: Calculate ci suffix QRCoder.Xaml
113-
run: echo "CI_TAG_XAML=-ci-$([datetime]::now.tostring("yyyyMMddHHmmss"))" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
114-
115-
- name: Build QRCoder NuGet package
116-
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!"
117-
118-
- name: Build QRCoder.Xaml NuGet package
119-
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!"
90+
- name: Upload artifacts
91+
uses: actions/upload-artifact@v4
92+
with:
93+
name: Nuget packages
94+
path: out/*
12095

121-
- name: Publish QRCoder and QRCoder.Xaml to Github packages
122-
run: dotnet nuget push "**/*.nupkg" --no-symbols --skip-duplicate --api-key $env:GH_PKG_SEC --source https://nuget.pkg.github.com/Shane32/index.json
96+
- name: Publish packages to Github packages
97+
run: dotnet nuget push "out\*" -k ${{secrets.GITHUB_TOKEN}}
Lines changed: 59 additions & 182 deletions
Original file line numberDiff line numberDiff line change
@@ -1,195 +1,72 @@
1-
name: Build, test, pack, push (Release)
1+
name: Build, pack, push (Release)
2+
23
on:
3-
workflow_dispatch:
4-
inputs:
5-
releaseNotes:
6-
description: 'Release Notes (use `n for new line)'
7-
required: true
8-
jobs:
9-
build:
10-
runs-on: windows-latest
11-
env:
12-
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
pack-push-ci:
10+
runs-on: windows-latest
1311
steps:
14-
- uses: actions/checkout@v4
12+
- uses: actions/checkout@v5
1513
name: Checkout Code
1614

17-
- name: Install additional .NET SDKs
18-
uses: actions/setup-dotnet@v4
15+
- name: Check github.ref starts with 'refs/tags/'
16+
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
17+
shell: bash
18+
run: |
19+
echo Error! github.ref does not start with 'refs/tags'
20+
echo github.ref: ${{ github.ref }}
21+
exit 1
22+
23+
- name: Set version number environment variable
24+
env:
25+
github_ref: ${{ github.ref }}
26+
shell: bash
27+
run: |
28+
version="${github_ref:10}"
29+
echo version=$version
30+
echo "version=$version" >> $GITHUB_ENV
31+
32+
- name: Install .NET SDK
33+
uses: actions/setup-dotnet@v5
1934
with:
20-
dotnet-version: |
21-
1.0.x
22-
2.0.x
23-
5.0.x
24-
6.0.x
25-
8.0.x
35+
dotnet-version: 8.0.x
36+
source-url: https://api.nuget.org/v3/index.json
37+
env:
38+
NUGET_AUTH_TOKEN: ${{secrets.NUGET_AUTH_TOKEN}}
2639

27-
- name: Restore NuGet Packages
28-
run: dotnet restore
29-
30-
- name: Build library
31-
run: dotnet build -c Release --no-restore
40+
- name: Build NuGet packages
41+
shell: bash
42+
run: dotnet pack -c Release -p:Version=$version -o out
3243

3344
- name: Upload artifacts
3445
uses: actions/upload-artifact@v4
3546
with:
36-
name: Compiled project
37-
path: ${{ github.workspace }}
38-
39-
test:
40-
needs: build
41-
runs-on: windows-latest
42-
steps:
43-
- name: Download artifacts
44-
uses: actions/download-artifact@v4
45-
with:
46-
name: Compiled project
47-
path: ${{ github.workspace }}
48-
49-
- name: Install additional .NET SDKs
50-
uses: actions/setup-dotnet@v4
51-
with:
52-
dotnet-version: |
53-
1.0.x
54-
2.0.x
55-
5.0.x
56-
6.0.x
57-
8.0.x
58-
59-
- name: Run test .NET 3.5
60-
working-directory: QRCoderTests
61-
run: dotnet test -c Release -f net35 --nologo --no-build # No coverage for NET3.5 because of bug in combination with Coverlet+Stronh naming
62-
63-
- name: Run test .NET 4.52
64-
working-directory: QRCoderTests
65-
run: dotnet test -c Release -f net452 --nologo --no-build # No coverage for NET4.5 because of bug in combination with Coverlet+Strong naming
66-
67-
- name: Run test .NET Core 1.1
68-
working-directory: QRCoderTests
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-
71-
- name: Run test .NET Core 2.0
72-
working-directory: QRCoderTests
73-
run: dotnet test -c Release -f netcoreapp2.0 --nologo /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
74-
75-
- name: Run test .NET 5.0
76-
working-directory: QRCoderTests
77-
run: dotnet test -c Release -f net5.0 --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
78-
79-
- name: Run test .NET 5.0 Windows
80-
working-directory: QRCoderTests
81-
run: dotnet test -c Release -f net5.0-windows --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
82-
83-
- name: Run test .NET 6.0
84-
working-directory: QRCoderTests
85-
run: dotnet test -c Release -f net6.0 --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
86-
87-
- name: Run test .NET 6.0 Windows
88-
working-directory: QRCoderTests
89-
run: dotnet test -c Release -f net6.0-windows --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
90-
91-
- name: Run API approval tests
92-
working-directory: QRCoderApiTests
93-
run: dotnet test -c Release --nologo --no-build
94-
95-
- name: Codecov update netcoreapp2.0
96-
uses: codecov/codecov-action@v4
97-
with:
98-
token: ${{ secrets.CODECOV_TOKEN }}
99-
disable_search: true
100-
fail_ci_if_error: true
101-
files: ./QRCoderTests/coverage.netcoreapp2.0.opencover.xml
102-
flags: netcoreapp2.0
47+
name: Nuget packages
48+
path: out/*
10349

104-
- name: Codecov update net5.0
105-
uses: codecov/codecov-action@v4
106-
with:
107-
token: ${{ secrets.CODECOV_TOKEN }}
108-
disable_search: true
109-
fail_ci_if_error: true
110-
files: ./QRCoderTests/coverage.net5.0.opencover.xml
111-
flags: net5.0
50+
- name: Publish packages to Github packages
51+
run: dotnet nuget push "out\*" -k ${{secrets.NUGET_AUTH_TOKEN}}
11252

113-
- name: Codecov update net5.0-windows
114-
uses: codecov/codecov-action@v4
115-
with:
116-
token: ${{ secrets.CODECOV_TOKEN }}
117-
disable_search: true
118-
fail_ci_if_error: true
119-
files: ./QRCoderTests/coverage.net5.0-windows.opencover.xml
120-
flags: net5.0-windows
121-
122-
- name: Codecov update net6.0
123-
uses: codecov/codecov-action@v4
124-
with:
125-
token: ${{ secrets.CODECOV_TOKEN }}
126-
disable_search: true
127-
fail_ci_if_error: true
128-
files: ./QRCoderTests/coverage.net5.0.opencover.xml
129-
flags: net6.0
130-
131-
- name: Codecov update net6.0-windows
132-
uses: codecov/codecov-action@v4
133-
with:
134-
token: ${{ secrets.CODECOV_TOKEN }}
135-
disable_search: true
136-
fail_ci_if_error: true
137-
files: ./QRCoderTests/coverage.net5.0-windows.opencover.xml
138-
flags: net6.0-windows
139-
140-
pack-push-release:
141-
needs: test
142-
runs-on: windows-latest
143-
env:
144-
GH_PKG_SEC: ${{ secrets.GITHUB_TOKEN }}
145-
steps:
146-
- name: Download artifacts
147-
uses: actions/download-artifact@v4
148-
with:
149-
name: Compiled project
150-
path: ${{ github.workspace }}
151-
152-
- name: Install additional .NET SDKs
153-
uses: actions/setup-dotnet@v4
154-
with:
155-
dotnet-version: |
156-
1.0.x
157-
2.0.x
158-
5.0.x
159-
6.0.x
160-
8.0.x
161-
162-
- name: Restore dependencies
163-
run: dotnet restore
164-
165-
- name: Get assembly version QRCoder
166-
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
167-
168-
- name: Clean assembly version QRCoder
169-
run: echo "ASSEM_VER_SHT=$($env:ASSEM_VER.substring(0, $env:ASSEM_VER.lastIndexOf(".")))" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
170-
171-
- name: Get assembly version QRCoder.Xaml
172-
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
173-
174-
- name: Clean assembly version QRCoder.Xaml
175-
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
176-
177-
- name: Build QRCoder NuGet package
178-
run: dotnet pack QRCoder\QRCoder.csproj -c Release --no-build /p:PackageVersion="$env:ASSEM_VER_SHT" /p:PackageReleaseNotes="${{ github.event.inputs.releaseNotes }}"
179-
180-
- name: Build QRCoder.Xaml NuGet package
181-
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 }}"
182-
183-
- name: Publish QRCoder and QRCoder.Xaml to Github packages
184-
run: dotnet nuget push "**/*.nupkg" --no-symbols --skip-duplicate --api-key $env:GH_PKG_SEC --source https://nuget.pkg.github.com/codebude/index.json
185-
186-
187-
clean:
188-
needs: [build, test, pack-push-release]
189-
if: always()
190-
runs-on: windows-latest
191-
steps:
192-
- name: Delete artifacts
193-
uses: GeekyEggo/delete-artifact@v5
53+
- name: Upload Nuget packages as release artifacts
54+
uses: actions/github-script@v8
19455
with:
195-
name: Compiled project
56+
github-token: ${{secrets.GITHUB_TOKEN}}
57+
script: |
58+
console.log('environment', process.versions);
59+
const fs = require('fs').promises;
60+
const { repo: { owner, repo }, sha } = context;
61+
62+
for (let file of await fs.readdir('out')) {
63+
console.log('uploading', file);
64+
65+
await github.rest.repos.uploadReleaseAsset({
66+
owner,
67+
repo,
68+
release_id: ${{ github.event.release.id }},
69+
name: file,
70+
data: await fs.readFile(`out/${file}`)
71+
});
72+
}

0 commit comments

Comments
 (0)