From 79d0fe861e6d05a96e457e50838eabcf18aad0ea Mon Sep 17 00:00:00 2001 From: Romain Beuque <556072+rbeuque74@users.noreply.github.com> Date: Mon, 24 Feb 2025 15:08:22 +0000 Subject: [PATCH] fix: github actions files + CODEOWNERS Signed-off-by: Romain Beuque <556072+rbeuque74@users.noreply.github.com> --- .github/workflows/build-and-test.yml | 46 +++++++++++++++------------- .github/workflows/release.yml | 19 +++++++----- CODEOWNERS | 1 + 3 files changed, 37 insertions(+), 29 deletions(-) create mode 100644 CODEOWNERS diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index c44506d..d13a8a8 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -1,38 +1,40 @@ # From https://learn.microsoft.com/en-us/dotnet/devops/dotnet-test-github-action -name: build and test +name: Build and test + +permissions: + contents: read on: push: pull_request: - branches: [ master ] + branches: [master] paths: - - '**.cs' - - '**.csproj' + - "**.cs" + - "**.csproj" env: - DOTNET_VERSION: '6.0.401' # The .NET SDK version to use + DOTNET_VERSION: "6.0.401" # The .NET SDK version to use jobs: build-and-test: - name: build-and-test-${{matrix.os}} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Setup .NET Core - uses: actions/setup-dotnet@v3 - with: - dotnet-version: ${{ env.DOTNET_VERSION }} + - name: Checkout Repo + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2 + with: + persist-credentials: "false" + + - name: Setup .NET Core + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} - - name: Install dependencies - run: dotnet restore + - name: Install dependencies + run: dotnet restore - - name: Build - run: dotnet build --configuration Release --no-restore + - name: Build + run: dotnet build --configuration Release --no-restore - - name: Test - run: dotnet test --no-restore --verbosity normal + - name: Test + run: dotnet test --no-restore --verbosity normal diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f4de25a..0b488c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,34 +1,39 @@ -name: release +name: Release csharp-ovh on Nuget on: push: tags: - - * + - "*" permissions: contents: read env: - DOTNET_VERSION: '6.0.401' # The .NET SDK version to use + DOTNET_VERSION: "6.0.401" # The .NET SDK version to use NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} NUGET_FEED_URL: https://api.nuget.org/v3/index.json jobs: publish: name: Publish csharp-ovh on Nuget runs-on: ubuntu-latest - needs: publish_binary steps: - name: Checkout Repo uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2 + with: + persist-credentials: "false" + - name: Setup .NET Core - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ env.DOTNET_VERSION }} + - name: Install dependencies run: dotnet restore + - name: Building Nuget package run: dotnet pack -c Release csharp-ovh/csharp-ovh.csproj + - name: Publish nuget package to Nuget.org run: | - dotnet nuget push ${{github.workspace}}/csharp-ovh/bin/Release/csharp-ovh.*.nupkg -s ${{ env.NUGET_FEED_URL }} -k ${{ env.NUGET_PUBLISH_KEY }} --skip-duplicate - echo "done publishing packages" \ No newline at end of file + dotnet nuget push ${{github.workspace}}/csharp-ovh/bin/Release/csharp-ovh.*.nupkg -s "${{ env.NUGET_FEED_URL }}" -k "${{ env.NUGET_PUBLISH_KEY }}" --skip-duplicate + echo "done publishing packages" diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..645c3a6 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +* @ovh/su-developer-platform-api-exposition \ No newline at end of file