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

feat: add Nuget package publish workflow #5

Merged
merged 4 commits into from
Sep 13, 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
34 changes: 34 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish NuGet Package

on:
release:
types: [published]

jobs:
nuget-org:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
dotnet-quality: 'ga'

- name: Restore dependencies
working-directory: src
run: dotnet restore

- name: Build
working-directory: src
run: dotnet build --configuration Release --no-restore

- name: Pack
working-directory: src
run: dotnet pack --configuration Release --no-build --output nupkgs

- name: Push to NuGet.org
working-directory: src
run: dotnet nuget push ./nupkgs/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_ORG_API_KEY }} --skip-duplicate
14 changes: 13 additions & 1 deletion src/AEMO.MDFF/AEMO.MDFF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,22 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.1.0-alpha2</Version>
<Title>AEMO.MDFF</Title>
<Authors>Akhan Zhakiyanov</Authors>
<Description>Parser for Australian Energy Market Operator (AEMO) Meter Data File Format (MDFF) specification</Description>
<Copyright>Copyright © 2024, Akhan Zhakiyanov. All rights reserved.</Copyright>
<PackageProjectUrl>https://github.com/ahanoff/aemo-mdff-net</PackageProjectUrl>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<RepositoryUrl>https://github.com/ahanoff/aemo-mdff-net</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>parsing;aemo;nem12;nem13;meter-reading</PackageTags>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Company>ahanoff</Company>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="FluentValidation" Version="11.9.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
Expand Down