From fda77ba23258c7d850de748ae7ee131c06a1d7e9 Mon Sep 17 00:00:00 2001 From: Eline Jorritsma Date: Fri, 19 Apr 2024 13:52:38 +0200 Subject: [PATCH] Add publishing workflow --- .github/workflows/BUILD_AND_TEST.yml | 2 +- .github/workflows/PUBLISH_PACKAGE.yml | 31 +++++++++++++++++++++++++++ SickRfid/SickRfid.csproj | 3 +++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/PUBLISH_PACKAGE.yml diff --git a/.github/workflows/BUILD_AND_TEST.yml b/.github/workflows/BUILD_AND_TEST.yml index 7b3a000..1271237 100644 --- a/.github/workflows/BUILD_AND_TEST.yml +++ b/.github/workflows/BUILD_AND_TEST.yml @@ -7,7 +7,7 @@ on: branches: [ develop, main ] jobs: - build_test_dstv_net: + build_test_rfid_controller: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/PUBLISH_PACKAGE.yml b/.github/workflows/PUBLISH_PACKAGE.yml new file mode 100644 index 0000000..653c006 --- /dev/null +++ b/.github/workflows/PUBLISH_PACKAGE.yml @@ -0,0 +1,31 @@ +name: Publish Package + +on: + push: + branches: [ main ] + paths: + - 'SickRfid/SickRfid.csproj' + - 'Directory.Build.props' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + name: Checkout repository + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 7.0.x + - name: Restore dependencies + run: dotnet restore + - name: Test + run: dotnet test + - name: Build + run: dotnet build --configuration Release --no-restore + - name: Publish SickRfidController to NuGet + uses: brandedoutcast/publish-nuget@v2.5.2 + with: + PROJECT_FILE_PATH: SickRfid/SickRfid.csproj + NUGET_KEY: ${{secrets.PUBLISH_TO_NUGET_ORG}} \ No newline at end of file diff --git a/SickRfid/SickRfid.csproj b/SickRfid/SickRfid.csproj index b3fdc84..feb5af7 100644 --- a/SickRfid/SickRfid.csproj +++ b/SickRfid/SickRfid.csproj @@ -31,5 +31,8 @@ .github\workflows\BUILD_AND_TEST.yml + + .github\workflows\PUBLISH_PACKAGE.yml +