From d05ca3e18163efb61925f260e4b11894596351d2 Mon Sep 17 00:00:00 2001 From: Akhan Zhakiyanov Date: Fri, 13 Sep 2024 15:47:27 +0800 Subject: [PATCH 1/4] feat: add Nuget package publish workflow --- .github/workflows/publish.yaml | 56 ++++++++++++++++++++++++++++++++++ src/AEMO.MDFF/AEMO.MDFF.csproj | 14 +++++++++ 2 files changed, 70 insertions(+) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..e6e6bb1 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,56 @@ +name: Publish NuGet Package + +on: + release: + types: [published] + +jobs: + github: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --configuration Release --no-restore + + - name: Pack + run: dotnet pack --configuration Release --no-build --output nupkgs + + - name: Push to GitHub Packages + run: | + for f in ./nupkgs/*.nupkg + do + dotnet nuget push $f --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --api-key ${{ secrets.GITHUB_TOKEN }} + done + + nuget-org: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --configuration Release --no-restore + + - name: Pack + run: dotnet pack --configuration Release --no-build --output nupkgs + + - name: Push to NuGet.org + run: dotnet nuget push ./nupkgs/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_ORG_API_KEY }} --skip-duplicate diff --git a/src/AEMO.MDFF/AEMO.MDFF.csproj b/src/AEMO.MDFF/AEMO.MDFF.csproj index 901be0d..bd35f5d 100644 --- a/src/AEMO.MDFF/AEMO.MDFF.csproj +++ b/src/AEMO.MDFF/AEMO.MDFF.csproj @@ -4,6 +4,20 @@ net8.0 enable enable + true + 0.1.0-alpha1 + AEMO.MDFF + Akhan Zhakiyanov + Parser for Australian Energy Market Operator (AEMO) Meter Data File Format (MDFF) specification + Copyright © 2024, Akhan Zhakiyanov. All rights reserved. + https://github.com/ahanoff/aemo-mdff-net + Apache-2.0 + https://github.com/ahanoff/aemo-mdff-net + git + parsing;aemo;nem12;nem13;meter-reading + true + ahanoff + icon.png From 9c84a9f6510edfee42dd095369b6075a43979866 Mon Sep 17 00:00:00 2001 From: Akhan Zhakiyanov Date: Fri, 13 Sep 2024 15:49:31 +0800 Subject: [PATCH 2/4] fix: remove icon --- src/AEMO.MDFF/AEMO.MDFF.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/AEMO.MDFF/AEMO.MDFF.csproj b/src/AEMO.MDFF/AEMO.MDFF.csproj index bd35f5d..330278e 100644 --- a/src/AEMO.MDFF/AEMO.MDFF.csproj +++ b/src/AEMO.MDFF/AEMO.MDFF.csproj @@ -17,7 +17,6 @@ parsing;aemo;nem12;nem13;meter-reading true ahanoff - icon.png From 7e0329b90adae21adb4c95f0f8469071cd17301a Mon Sep 17 00:00:00 2001 From: Akhan Zhakiyanov Date: Fri, 13 Sep 2024 15:52:12 +0800 Subject: [PATCH 3/4] fix: working dir --- .github/workflows/publish.yaml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index e6e6bb1..063c626 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -14,18 +14,23 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: '8.0.x' + 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 GitHub Packages + working-directory: src run: | for f in ./nupkgs/*.nupkg do @@ -41,16 +46,21 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: '8.0.x' + 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 From cc474af5bdbd4bf3ab6c2ba69e5ba15c8fcc10d2 Mon Sep 17 00:00:00 2001 From: Akhan Zhakiyanov Date: Fri, 13 Sep 2024 16:25:33 +0800 Subject: [PATCH 4/4] fix: remove dapper dependency --- .github/workflows/publish.yaml | 34 +--------------------------------- src/AEMO.MDFF/AEMO.MDFF.csproj | 3 +-- 2 files changed, 2 insertions(+), 35 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 063c626..3c12e93 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -4,39 +4,7 @@ on: release: types: [published] -jobs: - github: - 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 GitHub Packages - working-directory: src - run: | - for f in ./nupkgs/*.nupkg - do - dotnet nuget push $f --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --api-key ${{ secrets.GITHUB_TOKEN }} - done - +jobs: nuget-org: runs-on: ubuntu-latest diff --git a/src/AEMO.MDFF/AEMO.MDFF.csproj b/src/AEMO.MDFF/AEMO.MDFF.csproj index 330278e..8c2cff9 100644 --- a/src/AEMO.MDFF/AEMO.MDFF.csproj +++ b/src/AEMO.MDFF/AEMO.MDFF.csproj @@ -5,7 +5,7 @@ enable enable true - 0.1.0-alpha1 + 0.1.0-alpha2 AEMO.MDFF Akhan Zhakiyanov Parser for Australian Energy Market Operator (AEMO) Meter Data File Format (MDFF) specification @@ -20,7 +20,6 @@ -