diff --git a/.github/workflows/build-and-tests.yml b/.github/workflows/build-and-tests.yml index 4df8824..d492f96 100644 --- a/.github/workflows/build-and-tests.yml +++ b/.github/workflows/build-and-tests.yml @@ -1,6 +1,7 @@ name: Build & Tests -on: [push] +on: + workflow_call: jobs: dotnet-tests: diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml new file mode 100644 index 0000000..d66add0 --- /dev/null +++ b/.github/workflows/pipeline.yml @@ -0,0 +1,29 @@ +name: pipeline + +on: [push] + +jobs: + build_and_test: + name: Build & Test + uses: ./.github/workflows/build-and-tests.yml + + publish_npm: + name: Publish NPM + needs: build_and_test + if: startsWith(github.ref, 'refs/tags/') + uses: ./.github/workflows/publish-to-npm.yml + secrets: inherit + + publish_nuget: + name: Publish Nuget + needs: build_and_test + if: startsWith(github.ref, 'refs/tags/') + uses: ./.github/workflows/publish-to-nuget.yml + secrets: inherit + + publish_weavers: + name: Publish weavers + needs: build_and_test + if: startsWith(github.ref, 'refs/tags/') + uses: ./.github/workflows/publish-weavers.yml + secrets: inherit diff --git a/.github/workflows/publish-to-npm.yml b/.github/workflows/publish-to-npm.yml index e3a4e02..7de5d36 100644 --- a/.github/workflows/publish-to-npm.yml +++ b/.github/workflows/publish-to-npm.yml @@ -1,9 +1,10 @@ name: Publish Package to NPM on: - push: - tags: - - "*" + workflow_call: + secrets: + NPM_TOKEN: + required: true jobs: publish: diff --git a/.github/workflows/publish-to-nuget.yml b/.github/workflows/publish-to-nuget.yml index 8159e38..23c283e 100644 --- a/.github/workflows/publish-to-nuget.yml +++ b/.github/workflows/publish-to-nuget.yml @@ -1,8 +1,10 @@ name: Publish Package to Nuget.org + on: - push: - tags: - - "*" + workflow_call: + secrets: + NUGET_API_KEY: + required: true jobs: publish: diff --git a/.github/workflows/publish-weavers.yml b/.github/workflows/publish-weavers.yml index 106e426..332137c 100644 --- a/.github/workflows/publish-weavers.yml +++ b/.github/workflows/publish-weavers.yml @@ -1,8 +1,10 @@ name: Push local Packages to Nuget.org + on: - push: - tags: - - "*" + workflow_call: + secrets: + NUGET_API_KEY: + required: true jobs: publish: