From 4f607c568961a1ecb8e1aeff91730d6df77569a1 Mon Sep 17 00:00:00 2001 From: Oleg-Mozhey <93147982+Oleg-Mozhey@users.noreply.github.com> Date: Fri, 21 Feb 2025 15:01:09 +0400 Subject: [PATCH 1/3] Create release-playwright-bdd --- .github/workflows/release-playwright-bdd | 45 ++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/release-playwright-bdd diff --git a/.github/workflows/release-playwright-bdd b/.github/workflows/release-playwright-bdd new file mode 100644 index 00000000..5b69f9b7 --- /dev/null +++ b/.github/workflows/release-playwright-bdd @@ -0,0 +1,45 @@ +name: Release BDD nugets + +on: + workflow_dispatch: + +jobs: + build_application: + runs-on: ubuntu-latest + env: + DOTNET_NOLOGO: true + steps: + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: setup dotnet + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '6.0.x' + include-prerelease: true + - name: restore packages + run: dotnet restore + - name: build + run: dotnet build -c Release --no-restore + - name: Get version + run: | + export VER=$(grep -oP '\d+\.\d+\.\d+(?=)' Behavioral.Automation.Selenium/Behavioral.Automation/Behavioral.Automation.csproj) + echo "VER=$VER" >> $GITHUB_ENV + echo $VER + - name: Package app + run: | + dotnet pack ./Behavioral.Automation.Selenium/Behavioral.Automation/Behavioral.Automation.csproj \ + --configuration Release /p:Platform=\"AnyCPU\" \ + /p:PackageVersion=${{ env.VER }} --output ./ + - name: Create Release + uses: ncipollo/release-action@v1 + with: + tag: ${{ env.VER }} + artifacts: "Behavioral.Automation.${{ env.VER }}.nupkg" + bodyFile: "Behavioral.Automation.Selenium/CHANGELOG.md" + token: ${{ secrets.GITHUB_TOKEN }} + - name: Publish app into nuget.org + env: + NUGET_API_KEY: ${{ secrets.QUANTORI_NUGET_API_KEY }} + run: dotnet nuget push ./Behavioral.Automation.${{ env.VER }}.nupkg -s "https://api.nuget.org/v3/index.json" -k "$NUGET_API_KEY" --skip-duplicate From 65a92e0765ff046d873302c9085583aabfabfffd Mon Sep 17 00:00:00 2001 From: OlegMozhey Date: Fri, 7 Mar 2025 13:47:49 +0400 Subject: [PATCH 2/3] update BDD GHA release workflow --- .../workflows/{release-playwright-bdd => ReleaseBddNew.yaml} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{release-playwright-bdd => ReleaseBddNew.yaml} (95%) diff --git a/.github/workflows/release-playwright-bdd b/.github/workflows/ReleaseBddNew.yaml similarity index 95% rename from .github/workflows/release-playwright-bdd rename to .github/workflows/ReleaseBddNew.yaml index 5b69f9b7..2a852fb9 100644 --- a/.github/workflows/release-playwright-bdd +++ b/.github/workflows/ReleaseBddNew.yaml @@ -14,9 +14,9 @@ jobs: with: fetch-depth: 0 - name: setup dotnet - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: - dotnet-version: '6.0.x' + dotnet-version: '8.0.x' include-prerelease: true - name: restore packages run: dotnet restore From 461891f2e0aeb4dc160537e0c0026a78d0421172 Mon Sep 17 00:00:00 2001 From: OlegMozhey Date: Fri, 7 Mar 2025 14:13:11 +0400 Subject: [PATCH 3/3] test --- .github/workflows/ReleaseBddNew.yaml | 83 +++++++++++++++++----------- 1 file changed, 51 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ReleaseBddNew.yaml b/.github/workflows/ReleaseBddNew.yaml index 2a852fb9..4eb857d5 100644 --- a/.github/workflows/ReleaseBddNew.yaml +++ b/.github/workflows/ReleaseBddNew.yaml @@ -1,45 +1,64 @@ name: Release BDD nugets on: - workflow_dispatch: + push: + tags: + - 'async-abstractions-ui-v*' + branch: + - 'BAP-139-automatic-publication-for-playwright-part' jobs: build_application: runs-on: ubuntu-latest - env: - DOTNET_NOLOGO: true steps: - name: checkout uses: actions/checkout@v2 with: fetch-depth: 0 - - name: setup dotnet - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '8.0.x' - include-prerelease: true - - name: restore packages - run: dotnet restore - - name: build - run: dotnet build -c Release --no-restore - - name: Get version - run: | - export VER=$(grep -oP '\d+\.\d+\.\d+(?=)' Behavioral.Automation.Selenium/Behavioral.Automation/Behavioral.Automation.csproj) - echo "VER=$VER" >> $GITHUB_ENV - echo $VER - - name: Package app + + - name: Extract Version and Project Name + id: version run: | - dotnet pack ./Behavioral.Automation.Selenium/Behavioral.Automation/Behavioral.Automation.csproj \ - --configuration Release /p:Platform=\"AnyCPU\" \ - /p:PackageVersion=${{ env.VER }} --output ./ - - name: Create Release - uses: ncipollo/release-action@v1 - with: - tag: ${{ env.VER }} - artifacts: "Behavioral.Automation.${{ env.VER }}.nupkg" - bodyFile: "Behavioral.Automation.Selenium/CHANGELOG.md" - token: ${{ secrets.GITHUB_TOKEN }} - - name: Publish app into nuget.org - env: - NUGET_API_KEY: ${{ secrets.QUANTORI_NUGET_API_KEY }} - run: dotnet nuget push ./Behavioral.Automation.${{ env.VER }}.nupkg -s "https://api.nuget.org/v3/index.json" -k "$NUGET_API_KEY" --skip-duplicate + TAG_NAME=${{ github.ref_name }} + if [[ "$TAG_NAME" =~ ^async-abstractions-ui-v([0-9]+\.[0-9]+)$ ]]; then + PROJECT_PATH="Behavioral.Automation.Selenium/Behavioral.Automation/Behavioral.Automation.csproj" + PACKAGE_VERSION="${BASH_REMATCH[1]}" + else + echo "Unknown tag format: $TAG_NAME" + exit 1 + fi + + echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV + echo "PROJECT_PATH=$PROJECT_PATH" >> $GITHUB_ENV + echo "Detected Version: $PACKAGE_VERSION for project $PROJECT_PATH" + +# - name: setup dotnet +# uses: actions/setup-dotnet@v4 +# with: +# dotnet-version: '8.0.x' +# include-prerelease: true +# - name: restore packages +# run: dotnet restore +# - name: build +# run: dotnet build -c Release --no-restore +# - name: Get version +# run: | +# export VER=$(grep -oP '\d+\.\d+\.\d+(?=)' Behavioral.Automation.Selenium/Behavioral.Automation/Behavioral.Automation.csproj) +# echo "VER=$VER" >> $GITHUB_ENV +# echo $VER +# - name: Package app +# run: | +# dotnet pack ./Behavioral.Automation.Selenium/Behavioral.Automation/Behavioral.Automation.csproj \ +# --configuration Release /p:Platform=\"AnyCPU\" \ +# /p:PackageVersion=${{ env.VER }} --output ./ +# - name: Create Release +# uses: ncipollo/release-action@v1 +# with: +# tag: ${{ env.VER }} +# artifacts: "Behavioral.Automation.${{ env.VER }}.nupkg" +# bodyFile: "Behavioral.Automation.Selenium/CHANGELOG.md" +# token: ${{ secrets.GITHUB_TOKEN }} +# - name: Publish app into nuget.org +# env: +# NUGET_API_KEY: ${{ secrets.QUANTORI_NUGET_API_KEY }} +# run: dotnet nuget push ./Behavioral.Automation.${{ env.VER }}.nupkg -s "https://api.nuget.org/v3/index.json" -k "$NUGET_API_KEY" --skip-duplicate