From 35f067064d33045017e958fcd645b19edfebf9e0 Mon Sep 17 00:00:00 2001 From: Ruben Buniatyan Date: Thu, 25 Aug 2022 20:49:05 +0200 Subject: [PATCH] Add GitHub Actions workflow --- .github/workflows/build.yml | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..52c6bed7 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,45 @@ +name: Build + +on: + push: + paths: + - '.github/workflows/build.yml' + - 'src/**' + workflow_dispatch: + inputs: + publish: + description: 'Publish package' + default: false + required: false + type: boolean + +jobs: + build: + env: + BUILD_CONFIG: release + name: Build + runs-on: ubuntu-latest + steps: + + - name: Check out repository + uses: actions/checkout@v3 + + - name: Set up .NET + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.x + + - name: Install dependencies + run: dotnet restore + + - name: Build + run: dotnet build -c ${{ env.BUILD_CONFIG }} --no-restore -p:ContinuousIntegrationBuild=true + + #- name: Test + # run: dotnet test -c ${{ env.BUILD_CONFIG }} --no-restore + + - name: Publish + if: ${{ inputs.publish }} + run: | + dotnet pack -c ${{ env.BUILD_CONFIG }} --no-build + dotnet nuget push build_output/packages/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://apiint.nugettest.org/v3/index.json