diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index ee0b6a3f..524903c9 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -8,7 +8,7 @@ on: required: false default: 'Manual build and run tests' workflow_run: - workflows: [ Build ] + workflows: [ 'Build' ] types: - completed @@ -24,7 +24,7 @@ jobs: os: [ ubuntu-latest, windows-latest, macOS-latest ] steps: - name: Test - if: ${{ github.event.workflow_run.conclusion == 'success' }} + # if: ${{ github.event.workflow_run.conclusion == 'success' }} timeout-minutes: 60 run: >- dotnet test "${{ env.PROJECT_PATH }}" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d6dbffc4..d40f5180 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,9 +9,9 @@ on: default: 'Manual run' workflow_call: push: -# paths: -# - '**.cs' -# - '**.csproj' + paths: + - '**.cs' + - '**.csproj' pull_request: branches: [ master ] paths: diff --git a/.github/workflows/pack.yml b/.github/workflows/pack.yml index a813fb3d..710e4df4 100644 --- a/.github/workflows/pack.yml +++ b/.github/workflows/pack.yml @@ -2,10 +2,12 @@ name: 'Pack' on: workflow_run: - workflows: [ 'Build' ] + workflows: [ 'Build and Test' ] types: [ requested ] branches: [ master ] + workflow_call: + workflow_dispatch: inputs: reason: @@ -48,7 +50,7 @@ jobs: - name: Validate Version matches SemVer format run: | - if [[ ! "$VERSION" =~ ^([0-9]+\.){2}[0-9]+$ ]]; then + if [[ ! "$VERSION" =~ ^([0-9]+\.){2}[0-9]+(-[\w.]+)?$ ]]; then echo "The version does not match the SemVer format (X.Y.Z). Please provide a valid version." exit 1 fi @@ -93,7 +95,7 @@ jobs: --version 0.0.1-preview.304 - name: Validate NuGet package - run: | + run: >- dotnet-validate package local ./artifacts/**.nupkg - name: Upload artifacts diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 605ba8b3..8f8c8a8f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,9 +7,14 @@ on: description: 'The reason for running the workflow' required: false default: 'Manual publish to nuget' + + workflow_run: + workflows: [ 'Pack' ] + types: + - completed push: tags: - - '[0-9]+.[0-9]+.[0-9]+' + - '[0-9]+.[0-9]+.[0-9]+(-[\w.]+)?' concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}