Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add Github Action that pushes packages to nuget (will replace appveyor) #168

Merged
merged 5 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/release_nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
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 and EDILibrary.Core
working-directory: "EDILibrary"
# 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
- 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
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
# 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.

# 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))
30 changes: 0 additions & 30 deletions appveyor.yml

This file was deleted.

Loading