diff --git a/.github/workflows/PlaywrightProjectTests.yml b/.github/workflows/PlaywrightProjectTests.yml index 373d948..bbbac1d 100644 --- a/.github/workflows/PlaywrightProjectTests.yml +++ b/.github/workflows/PlaywrightProjectTests.yml @@ -3,6 +3,7 @@ name: Playwright project tests on: workflow_dispatch: pull_request: + workflow_call: jobs: PlaywrightProjectTests: @@ -13,11 +14,5 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: '8.0.x' - - name: Run Blazor app - run: | - cd ./src/BlazorApp - dotnet run & - - name: Test Blazor app - run: | - cd ./Behavioral.Automation.Playwright/UITests - dotnet test + call-workflow-1-in-local-repo: + uses: ./.github/workflows/RunBlazorApp.yml diff --git a/.github/workflows/ReleaseBddNew.yaml b/.github/workflows/ReleaseBddNew.yaml new file mode 100644 index 0000000..07c57fa --- /dev/null +++ b/.github/workflows/ReleaseBddNew.yaml @@ -0,0 +1,70 @@ +name: Release BDD nugets + +# First GHA file - publish only from tag, specify all attributes +# Next GHA workflow - publish patch releases automatically + +on: + push: + tags: + - 'async-abstractions-ui-v*' + branches: # should be semver major.minor.patch + - 'BAP-139-automatic-publication-for-playwright-part-v*' + +jobs: + get_project_and_version_from_tag: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Extract Version and Project Name + id: version + run: | + TAG_NAME=${{ github.ref_name }} + if [[ "$TAG_NAME" =~ ^async-abstractions-ui-v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then + PROJECT_PATH="Behavioral.Automation.AsyncAbstractions.UI/Behavioral.Automation.AsyncAbstractions.UI.csproj" + PACKAGE_VERSION="${BASH_REMATCH[1]}" + elif [[ "$TAG_NAME" =~ ^BAP-139-automatic-publication-for-playwright-part-v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then + PROJECT_PATH="Behavioral.Automation.AsyncAbstractions.UI/Behavioral.Automation.AsyncAbstractions.UI.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 diff --git a/.github/workflows/RunBlazorApp.yml b/.github/workflows/RunBlazorApp.yml new file mode 100644 index 0000000..9ccab71 --- /dev/null +++ b/.github/workflows/RunBlazorApp.yml @@ -0,0 +1,13 @@ +name: Playwright project tests + +on: + workflow_call: + +jobs: + RunBlazorApp: + runs-on: ubuntu-latest + steps: + - name: Run Blazor app + run: | + cd ./src/BlazorApp + dotnet run &