From ab4420052e0854dee6ac51a669bc8761377ca568 Mon Sep 17 00:00:00 2001 From: Patrick Hallisey Date: Tue, 30 Jul 2024 17:32:20 -0700 Subject: [PATCH 1/6] release test --- .github/workflows/release.yml | 59 ++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e2486a02..07365804 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,7 @@ name: Release package on: + workflow_dispatch: release: types: [published] schedule: @@ -46,15 +47,15 @@ jobs: --logger "trx;LogFileName=${{ github.workspace }}/artifacts/test-results/smoke.trx" ${{ env.version_suffix_args }} - - name: Run Live Tests - run: dotnet test ./tests/OpenAI.Tests.csproj - --configuration Release - --filter="TestCategory!=Smoke&TestCategory!=Images&TestCategory!=Moderations&TestCategory!=Manual" - --logger "trx;LogFilePrefix=live" - --results-directory ${{ github.workspace }}/artifacts/test-results - ${{ env.version_suffix_args }} - env: - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + # - name: Run Live Tests + # run: dotnet test + # --configuration Release + # --filter="TestCategory!=Smoke&TestCategory!=Images&TestCategory!=Moderations&TestCategory!=Manual" + # --logger "trx;LogFilePrefix=live" + # --results-directory ${{ github.workspace }}/artifacts/test-results + # ${{ env.version_suffix_args }} + # env: + # OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - name: Upload artifact uses: actions/upload-artifact@v2 @@ -73,6 +74,8 @@ jobs: steps: - uses: actions/download-artifact@v2 + - run: ls -R ${{ github.workspace }} + # Append the nuget package to the github release that triggered this workflow - name: Checkout code uses: actions/checkout@v2 @@ -84,24 +87,24 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: NuGet authenticate - run: dotnet nuget add source - "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" - --name "github" - --username ${{ github.actor }} - --password ${{ secrets.GITHUB_TOKEN }} - --store-password-in-clear-text + # - name: NuGet authenticate + # run: dotnet nuget add source + # "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" + # --name "github" + # --username ${{ github.actor }} + # --password ${{ secrets.GITHUB_TOKEN }} + # --store-password-in-clear-text - - name: Publish package to local feed - run: dotnet nuget push - ${{github.workspace}}/build-artifacts/packages/*.nupkg - --source github - --skip-duplicate + # - name: Publish package to local feed + # run: dotnet nuget push + # ${{github.workspace}}/build-artifacts/packages/*.nupkg + # --source github + # --skip-duplicate - - name: Publish package to nuget.org - if: github.event_name == 'release' - run: dotnet nuget push - ${{github.workspace}}/build-artifacts/packages/*.nupkg - --source https://api.nuget.org/v3/index.json - --api-key ${{ secrets.NUGET_API_KEY }} - --skip-duplicate + # - name: Publish package to nuget.org + # if: github.event_name == 'release' + # run: dotnet nuget push + # ${{github.workspace}}/build-artifacts/packages/*.nupkg + # --source https://api.nuget.org/v3/index.json + # --api-key ${{ secrets.NUGET_API_KEY }} + # --skip-duplicate From 80bbf2c490a5ee0c9d652e410fdd700aa871a04d Mon Sep 17 00:00:00 2001 From: Patrick Hallisey Date: Tue, 30 Jul 2024 17:32:25 -0700 Subject: [PATCH 2/6] release test --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 07365804..ce61b46f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,9 @@ name: Release package on: - workflow_dispatch: + push: + branches: + - users/hallipr/release-test release: types: [published] schedule: From 23da89dc64960a8751352df5bacec67c6668c626 Mon Sep 17 00:00:00 2001 From: Patrick Hallisey Date: Wed, 31 Jul 2024 10:24:12 -0700 Subject: [PATCH 3/6] Check directory contents of the downloaded artifact --- .github/workflows/live-test.yml | 2 +- .github/workflows/main.yml | 2 +- .github/workflows/release.yml | 38 +++++++++++++++------------------ 3 files changed, 19 insertions(+), 23 deletions(-) diff --git a/.github/workflows/live-test.yml b/.github/workflows/live-test.yml index b3874d5b..a8a706e7 100644 --- a/.github/workflows/live-test.yml +++ b/.github/workflows/live-test.yml @@ -35,7 +35,7 @@ jobs: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - name: Upload artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} with: name: test-artifacts diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e4943014..54325dc6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,7 +40,7 @@ jobs: ${{ env.version_suffix_args}} - name: Upload artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} with: name: build-artifacts diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ce61b46f..09606e83 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,7 +60,7 @@ jobs: # OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - name: Upload artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} with: name: build-artifacts @@ -70,18 +70,13 @@ jobs: name: Publish Package needs: build runs-on: ubuntu-latest - permissions: - packages: write - contents: write steps: - - uses: actions/download-artifact@v2 - - - run: ls -R ${{ github.workspace }} - - # Append the nuget package to the github release that triggered this workflow - name: Checkout code uses: actions/checkout@v2 + - name: Download build artifacts + uses: actions/download-artifact@v4 + - name: Upload release asset if: github.event_name == 'release' run: gh release upload ${{ github.event.release.tag_name }} @@ -89,19 +84,20 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - name: NuGet authenticate - # run: dotnet nuget add source - # "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" - # --name "github" - # --username ${{ github.actor }} - # --password ${{ secrets.GITHUB_TOKEN }} - # --store-password-in-clear-text + - name: NuGet authenticate + run: dotnet nuget add source + "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" + --name "github" + --username ${{ github.actor }} + --password ${{ secrets.GITHUB_TOKEN }} + --store-password-in-clear-text - # - name: Publish package to local feed - # run: dotnet nuget push - # ${{github.workspace}}/build-artifacts/packages/*.nupkg - # --source github - # --skip-duplicate + - name: Publish package to local feed + run: dotnet nuget push + ${{github.workspace}}/build-artifacts/packages/*.nupkg + --source "github" + --api-key ${{ secrets.GITHUB_TOKEN }} + --skip-duplicate # - name: Publish package to nuget.org # if: github.event_name == 'release' From 1626520691c7a66f8ca61ce9cbfd733074537f31 Mon Sep 17 00:00:00 2001 From: Patrick Hallisey Date: Wed, 31 Jul 2024 11:21:32 -0700 Subject: [PATCH 4/6] Disable live test --- .github/workflows/release.yml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 09606e83..196b8f52 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,9 +5,6 @@ name: Release package on: - push: - branches: - - users/hallipr/release-test release: types: [published] schedule: @@ -18,7 +15,7 @@ jobs: build: name: Build runs-on: ubuntu-latest - environment: Live Testing + # environment: Live Testing env: version_suffix_args: ${{ github.event_name == 'schedule' && format('/p:VersionSuffix="alpha.{0}"', github.run_number) || '' }} permissions: @@ -99,10 +96,10 @@ jobs: --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate - # - name: Publish package to nuget.org - # if: github.event_name == 'release' - # run: dotnet nuget push - # ${{github.workspace}}/build-artifacts/packages/*.nupkg - # --source https://api.nuget.org/v3/index.json - # --api-key ${{ secrets.NUGET_API_KEY }} - # --skip-duplicate + - name: Publish package to nuget.org + if: github.event_name == 'release' + run: dotnet nuget push + ${{github.workspace}}/build-artifacts/packages/*.nupkg + --source https://api.nuget.org/v3/index.json + --api-key ${{ secrets.NUGET_API_KEY }} + --skip-duplicate From ccae2ffeb2c1156744de0626ea19eba2619ec32e Mon Sep 17 00:00:00 2001 From: Patrick Hallisey Date: Wed, 31 Jul 2024 12:30:24 -0700 Subject: [PATCH 5/6] Enable live tests --- .github/workflows/release.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 196b8f52..1a4b448d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: build: name: Build runs-on: ubuntu-latest - # environment: Live Testing + environment: Live Testing env: version_suffix_args: ${{ github.event_name == 'schedule' && format('/p:VersionSuffix="alpha.{0}"', github.run_number) || '' }} permissions: @@ -46,15 +46,15 @@ jobs: --logger "trx;LogFileName=${{ github.workspace }}/artifacts/test-results/smoke.trx" ${{ env.version_suffix_args }} - # - name: Run Live Tests - # run: dotnet test - # --configuration Release - # --filter="TestCategory!=Smoke&TestCategory!=Images&TestCategory!=Moderations&TestCategory!=Manual" - # --logger "trx;LogFilePrefix=live" - # --results-directory ${{ github.workspace }}/artifacts/test-results - # ${{ env.version_suffix_args }} - # env: - # OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + - name: Run Live Tests + run: dotnet test + --configuration Release + --filter="TestCategory!=Smoke&TestCategory!=Images&TestCategory!=Moderations&TestCategory!=Manual" + --logger "trx;LogFilePrefix=live" + --results-directory ${{ github.workspace }}/artifacts/test-results + ${{ env.version_suffix_args }} + env: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - name: Upload artifact uses: actions/upload-artifact@v4 From e5f02fbd15aa64f9a1cf6e5c62d205e7726e793d Mon Sep 17 00:00:00 2001 From: Patrick Hallisey Date: Wed, 31 Jul 2024 12:32:23 -0700 Subject: [PATCH 6/6] Reduce live test scope --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1a4b448d..05989aaf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,7 +47,7 @@ jobs: ${{ env.version_suffix_args }} - name: Run Live Tests - run: dotnet test + run: dotnet test ./tests/OpenAI.Tests.csproj --configuration Release --filter="TestCategory!=Smoke&TestCategory!=Images&TestCategory!=Moderations&TestCategory!=Manual" --logger "trx;LogFilePrefix=live"