From 7027d4d6442f2844c80b26d301e272aa7ec67938 Mon Sep 17 00:00:00 2001 From: konstantin Date: Mon, 1 Jul 2024 09:14:48 +0200 Subject: [PATCH 1/5] Add Release Github Action copied from here: https://github.com/Hochfrequenz/TransformerBeeClient.NET/blob/4b48a0eeeb80b8a54e007a4c03d3a93d99ff1591/.github/workflows/release_nuget.yml --- .github/workflows/release_nuget.yml | 49 +++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/release_nuget.yml diff --git a/.github/workflows/release_nuget.yml b/.github/workflows/release_nuget.yml new file mode 100644 index 0000000..25a5c7c --- /dev/null +++ b/.github/workflows/release_nuget.yml @@ -0,0 +1,49 @@ +name: Nuget Release + +on: + release: + types: [created, edited] + +jobs: + run_tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup .NET Core + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.100 + - name: Build/Check for compile errors (dotnet build) + run: dotnet build --configuration Release + - name: Run Unit Tests (dotnet test) # never ever release with failing tests! + run: dotnet test --configuration Release + push_release: + needs: run_tests + if: startsWith(github.ref, 'refs/tags/v') + runs-on: windows-latest + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: "true" + steps: + - uses: actions/checkout@v4 + - name: Setup .NET Core + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.100 + - uses: olegtarasov/get-tag@v2.1 + id: tagTBC + with: + tagRegex: "v(\\d+\\.\\d+\\.\\d+)" + - name: Build/Check for compile errors (dotnet build) + run: dotnet build --configuration Release + - name: Create Package EdiLibrary (dotnet pack) + working-directory: "EDILibrary" + run: dotnet pack EDILibrary.csproj --configuration Release -p:PackageVersion="${{ steps.tagTBC.outputs.tag }}" + - name: Setup Nuget.exe + uses: warrenbuckley/Setup-Nuget@v1 + - name: Nuget push EDILibrary + working-directory: "EDILibrary" + # token: https://github.com/Hochfrequenz/EDILibrary/settings/secrets/actions/NUGET_ORG_PUSH_TOKEN + # expires 2025-02-01 + run: | + nuget setApiKey ${{ secrets.NUGET_ORG_PUSH_TOKEN }} + nuget push .\bin\Release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -NoSymbols From 7890be185ff8029a6a1cbad74fc016c83d350f8f Mon Sep 17 00:00:00 2001 From: konstantin Date: Mon, 1 Jul 2024 09:25:41 +0200 Subject: [PATCH 2/5] Core? Standard? IDK --- .github/workflows/release_nuget.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release_nuget.yml b/.github/workflows/release_nuget.yml index 25a5c7c..ec55332 100644 --- a/.github/workflows/release_nuget.yml +++ b/.github/workflows/release_nuget.yml @@ -35,15 +35,25 @@ jobs: tagRegex: "v(\\d+\\.\\d+\\.\\d+)" - name: Build/Check for compile errors (dotnet build) run: dotnet build --configuration Release - - name: Create Package EdiLibrary (dotnet pack) + - name: Create Package EDILibrary (dotnet pack) working-directory: "EDILibrary" run: dotnet pack EDILibrary.csproj --configuration Release -p:PackageVersion="${{ steps.tagTBC.outputs.tag }}" - name: Setup Nuget.exe uses: warrenbuckley/Setup-Nuget@v1 - - name: Nuget push EDILibrary + - name: Nuget push EDILibrary and EDILibrary.Core working-directory: "EDILibrary" # token: https://github.com/Hochfrequenz/EDILibrary/settings/secrets/actions/NUGET_ORG_PUSH_TOKEN - # expires 2025-02-01 + run: | + nuget setApiKey ${{ secrets.NUGET_ORG_PUSH_TOKEN }} + nuget push .\bin\Release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -NoSymbols + - name: Create Package EDILibrary.Standard (dotnet pack) + working-directory: "EDILibraryBase" + run: dotnet pack EDILibrary.Standard.csproj --configuration Release -p:PackageVersion="${{ steps.tagTBC.outputs.tag }}" + - name: Setup Nuget.exe + uses: warrenbuckley/Setup-Nuget@v1 + - name: Nuget push EDILibrary.Standard + working-directory: "EDILibraryBase" + # token: https://github.com/Hochfrequenz/EDILibrary/settings/secrets/actions/NUGET_ORG_PUSH_TOKEN run: | nuget setApiKey ${{ secrets.NUGET_ORG_PUSH_TOKEN }} nuget push .\bin\Release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -NoSymbols From 9504644071a95db1766329bb006dbfd7922a10e6 Mon Sep 17 00:00:00 2001 From: konstantin Date: Mon, 1 Jul 2024 10:48:34 +0200 Subject: [PATCH 3/5] Delete appveyor.yml --- appveyor.yml | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index fe2deac..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,30 +0,0 @@ -image: Visual Studio 2022 - -install: - - choco install gitversion.portable -pre -y - -assembly_info: - patch: false - -dotnet_csproj: - patch: true -# file: 'Build\CodeJam.Default.props' - version: '$(version)' - package_version: '$(version)' - - -before_build: - - nuget restore - - ps: gitversion /l console /output buildserver /updateAssemblyInfo - -build: - project: EDILibrary.sln - -deploy: - provider: NuGet - skip_symbols: true - artifact: /.*\.nupkg/ - -artifacts: - - path: '**\*.nupkg' # find all NuGet packages recursively - name: Nuget packages From 99d97578e1478351a3a84cb20d76f4164b30bd3a Mon Sep 17 00:00:00 2001 From: konstantin Date: Mon, 1 Jul 2024 10:51:37 +0200 Subject: [PATCH 4/5] Update README.md --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 45b542b..bd6b0ef 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,9 @@ -# Build status -[![Build status](https://ci.appveyor.com/api/projects/status/bug7q8cj52n5mvam?svg=true)](https://ci.appveyor.com/project/JoschaMetze/edilibrary) -# EDILibrary -EDI Library for german energy market +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) +![Nuget Package](https://badgen.net/nuget/v/EdiLibrary.Core) -[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) +# EDILibrary +EDI Library for German energy market -# This library won't provide much value without the corresponding template files. These are distributed separately by Hochfrequenz. Please contact info (at) hochfrequenz.de for more information. From 8951a9b5dbeb8cf5ac4a9ee6b667d3415e6c7fe1 Mon Sep 17 00:00:00 2001 From: konstantin Date: Mon, 1 Jul 2024 10:57:04 +0200 Subject: [PATCH 5/5] Update README.md --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bd6b0ef..575b270 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,15 @@ This library won't provide much value without the corresponding template files. These are distributed separately by Hochfrequenz. Please contact info (at) hochfrequenz.de for more information. # Development -## I want to debug this library + +## I want to release a new version of this library +Click on [Draft new Release](https://github.com/Hochfrequenz/EDILibrary/releases/new) to create a new release. +When you create a new release, you may also create a new tag. +Tags and releases should have a `v` prefix. So use `v1.2.3` and **not** `1.2.3`. + +Pushes of built packages to nuget [are only triggered on release](.github/workflows/release_nuget.yml), not on tag alone. +Having releases instead of only tags is preferable, because of the release notes which are included in e.g. dependabot PRs. + +## I want to debug this library from a project that uses it EDILibrary comes with SourceLink enabled, so you can load its debugging symbols from nuget. In Visual Studio, under Settingsāž”Debugging **un**check "Enable Just My Code" (or follow the instructions [here](https://stackoverflow.com/a/654711/10009545))