-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #331 from codebude/feature/new-build-process-and-s…
…cripts Feature/new build process and scripts
- Loading branch information
Showing
9 changed files
with
314 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
name: Build, test, pack, push (CI) | ||
on: | ||
|
||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
env: | ||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | ||
steps: | ||
- uses: actions/checkout@v1 | ||
name: Checkout Code | ||
|
||
- name: Setup MSBuild Ppth | ||
uses: microsoft/setup-msbuild@v1 | ||
|
||
- name: Setup NuGet | ||
uses: NuGet/setup-nuget@v1.0.2 | ||
|
||
- name: Restore NuGet Packages | ||
run: nuget restore QRCoder.sln | ||
|
||
- name: Build library | ||
run: msbuild QRCoder.sln /p:Configuration=Release /nr:false /t:Rebuild | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v1.0.0 | ||
with: | ||
name: Compiled project | ||
path: D:\a\qrcoder\qrcoder | ||
|
||
test: | ||
needs: build | ||
runs-on: windows-latest | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v1.0.0 | ||
with: | ||
name: Compiled project | ||
path: D:\a\qrcoder\qrcoder | ||
- name: Run test .NET 3.5 | ||
run: dotnet test -c Release -f net35 --nologo --no-build # No coverage for NET3.5 because of bug in combination with Coverlet+Stron naming | ||
- name: Run test .NET 4.52 | ||
run: dotnet test -c Release -f net452 --nologo --no-build # No coverage for NET4.5 because of bug in combination with Coverlet+Stron naming | ||
# Skip 1.1 test due to missing support on Github runner | ||
# - name: Run test .NET Core 1.1 | ||
# run: dotnet test -c Release -f netcoreapp1.1 --nologo | ||
- name: Run test .NET Core 2.0 | ||
run: dotnet test -c Release -f netcoreapp2.0 --nologo /p:CollectCoverage=true /p:CoverletOutputFormat=opencover | ||
- name: Run test .NET 5.0 | ||
run: dotnet test -c Release -f net5.0 --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover | ||
- name: Run test .NET 5.0 Windows | ||
run: dotnet test -c Release -f net5.0-windows --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover | ||
- name: Codecov update netcoreapp2.0 | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./QRCoderTests/coverage.netcoreapp2.0.opencover.xml | ||
flags: netcoreapp2.0 | ||
- name: Codecov update net5.0 | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./QRCoderTests/coverage.net5.0.opencover.xml | ||
flags: net5.0 | ||
- name: Codecov update net5.0-windows | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./QRCoderTests/coverage.net5.0-windows.opencover.xml | ||
flags: net5.0-windows | ||
|
||
pack-push-ci: | ||
needs: test | ||
runs-on: windows-latest | ||
env: | ||
GH_PKG_SEC: ${{ secrets.GH_PKG_REPO }} | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v1.0.0 | ||
with: | ||
name: Compiled project | ||
path: D:\a\qrcoder\qrcoder | ||
- name: Restore dependencies | ||
run: dotnet restore | ||
- name: Get assembly version | ||
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 | ||
- name: Clean assembly version | ||
run: echo "ASSEM_VER_SHT=$($env:ASSEM_VER.substring(0, $env:ASSEM_VER.lastIndexOf(".")))" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append | ||
- name: Calculate ci suffix | ||
run: echo "CI_TAG=-ci-$([datetime]::now.tostring("yyyyMMddHHmmss"))" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append | ||
- name: Build NuGet package | ||
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!" | ||
- name: Publish to Github packages | ||
run: dotnet nuget push "**/*.nupkg" --no-symbols --skip-duplicate --api-key $env:GH_PKG_SEC --source https://nuget.pkg.github.com/codebude/index.json | ||
|
||
|
||
clean: | ||
needs: [build, test, pack-push-ci] | ||
if: always() | ||
runs-on: windows-latest | ||
steps: | ||
- name: Delete artifacts | ||
uses: GeekyEggo/delete-artifact@v1.0.0 | ||
with: | ||
name: Compiled project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
name: Build, test, pack, push (Release) | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
releaseNotes: | ||
description: 'Release Notes (use `n for new line)' | ||
required: true | ||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
env: | ||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | ||
steps: | ||
- uses: actions/checkout@v1 | ||
name: Checkout Code | ||
|
||
- name: Setup MSBuild Ppth | ||
uses: microsoft/setup-msbuild@v1 | ||
|
||
- name: Setup NuGet | ||
uses: NuGet/setup-nuget@v1.0.2 | ||
|
||
- name: Restore NuGet Packages | ||
run: nuget restore QRCoder.sln | ||
|
||
- name: Build library | ||
run: msbuild QRCoder.sln /p:Configuration=Release /nr:false /t:Rebuild | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v1.0.0 | ||
with: | ||
name: Compiled project | ||
path: D:\a\qrcoder\qrcoder | ||
|
||
test: | ||
needs: build | ||
runs-on: windows-latest | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v1.0.0 | ||
with: | ||
name: Compiled project | ||
path: D:\a\qrcoder\qrcoder | ||
- name: Run test .NET 3.5 | ||
run: dotnet test -c Release -f net35 --nologo --no-build # No coverage for NET3.5 because of bug in combination with Coverlet+Stron naming | ||
- name: Run test .NET 4.52 | ||
run: dotnet test -c Release -f net452 --nologo --no-build # No coverage for NET4.5 because of bug in combination with Coverlet+Stron naming | ||
# Skip 1.1 test due to missing support on Github runner | ||
# - name: Run test .NET Core 1.1 | ||
# run: dotnet test -c Release -f netcoreapp1.1 --nologo | ||
- name: Run test .NET Core 2.0 | ||
run: dotnet test -c Release -f netcoreapp2.0 --nologo /p:CollectCoverage=true /p:CoverletOutputFormat=opencover | ||
- name: Run test .NET 5.0 | ||
run: dotnet test -c Release -f net5.0 --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover | ||
- name: Run test .NET 5.0 Windows | ||
run: dotnet test -c Release -f net5.0-windows --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover | ||
- name: Codecov update netcoreapp2.0 | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./QRCoderTests/coverage.netcoreapp2.0.opencover.xml | ||
flags: netcoreapp2.0 | ||
- name: Codecov update net5.0 | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./QRCoderTests/coverage.net5.0.opencover.xml | ||
flags: net5.0 | ||
- name: Codecov update net5.0-windows | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./QRCoderTests/coverage.net5.0-windows.opencover.xml | ||
flags: net5.0-windows | ||
|
||
pack-push-release: | ||
needs: test | ||
runs-on: windows-latest | ||
env: | ||
GH_PKG_SEC: ${{ secrets.GH_PKG_REPO }} | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v1.0.0 | ||
with: | ||
name: Compiled project | ||
path: D:\a\qrcoder\qrcoder | ||
- name: Restore dependencies | ||
run: dotnet restore | ||
- name: Get assembly version | ||
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 | ||
- name: Clean assembly version | ||
run: echo "ASSEM_VER_SHT=$($env:ASSEM_VER.substring(0, $env:ASSEM_VER.lastIndexOf(".")))" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append | ||
- name: Build NuGet package | ||
run: dotnet pack QRCoder\QRCoder.csproj -c Release --no-build /p:PackageVersion="$env:ASSEM_VER_SHT" /p:PackageReleaseNotes="${{ github.event.inputs.releaseNotes }}" | ||
- name: Publish to Github packages | ||
run: dotnet nuget push "**/*.nupkg" --no-symbols --skip-duplicate --api-key $env:GH_PKG_SEC --source https://nuget.pkg.github.com/codebude/index.json | ||
|
||
|
||
clean: | ||
needs: [build, test, pack-push-release] | ||
if: always() | ||
runs-on: windows-latest | ||
steps: | ||
- name: Delete artifacts | ||
uses: GeekyEggo/delete-artifact@v1.0.0 | ||
with: | ||
name: Compiled project |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
## About | ||
|
||
QRCoder is a simple library, written in C#.NET, which enables you to create QR codes. It hasn't any dependencies to other libraries and is available as .NET Framework and .NET Core PCL version on NuGet. | ||
|
||
*** | ||
|
||
## Documentation | ||
|
||
👉 *Your first place to go should be our wiki. Here you can find a detailed documentation of the QRCoder and its functions.* | ||
* [**QRCode Wiki**](https://github.com/codebude/QRCoder/wiki) | ||
* [Creator's blog (english)](http://en.code-bude.net/2013/10/17/qrcoder-an-open-source-qr-code-generator-implementation-in-csharp/) | ||
* [Creator's blog (german)](http://code-bude.net/2013/10/17/qrcoder-eine-open-source-qr-code-implementierung-in-csharp/) | ||
|
||
|
||
## Usage / Quick start | ||
|
||
You only need five lines of code, to generate and view your first QR code. | ||
|
||
```csharp | ||
QRCodeGenerator qrGenerator = new QRCodeGenerator(); | ||
QRCodeData qrCodeData = qrGenerator.CreateQrCode("The text which should be encoded.", QRCodeGenerator.ECCLevel.Q); | ||
QRCode qrCode = new QRCode(qrCodeData); | ||
Bitmap qrCodeImage = qrCode.GetGraphic(20); | ||
``` | ||
|
||
### Optional parameters and overloads | ||
|
||
The GetGraphics-method has some more overloads. The first two enable you to set the color of the QR code graphic. One uses Color-class-types, the other HTML hex color notation. | ||
|
||
```csharp | ||
//Set color by using Color-class types | ||
Bitmap qrCodeImage = qrCode.GetGraphic(20, Color.DarkRed, Color.PaleGreen, true); | ||
|
||
//Set color by using HTML hex color notation | ||
Bitmap qrCodeImage = qrCode.GetGraphic(20, "#000ff0", "#0ff000"); | ||
``` | ||
|
||
The other overload enables you to render a logo/image in the center of the QR code. | ||
|
||
```csharp | ||
Bitmap qrCodeImage = qrCode.GetGraphic(20, Color.Black, Color.White, (Bitmap)Bitmap.FromFile("C:\\myimage.png")); | ||
``` | ||
|
||
There are a plenty of other options. So feel free to read more on that in our wiki: [Wiki: How to use QRCoder](https://github.com/codebude/QRCoder/wiki/How-to-use-QRCoder) | ||
|
||
## Help & Issues | ||
|
||
If you think you have a bug or have new ideas/feature requests, then feel free to open a new issues: https://github.com/codebude/QRCoder/issues | ||
In case you have a question about using the library (and couldn't find an answer in our wiki), feel free to open a new question/discussion: https://github.com/codebude/QRCoder/discussions | ||
|
||
|
||
## Legal information and credits | ||
|
||
QRCoder is a project by [Raffael Herrmann](https://raffaelherrmann.de) and was first released in 10/2013. It's licensed under the [MIT license](https://github.com/codebude/QRCoder/blob/master/LICENSE.txt). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.