diff --git a/.github/workflows/build-master.yml b/.github/workflows/build-master.yml deleted file mode 100644 index e0da0eef2..000000000 --- a/.github/workflows/build-master.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: Build Master - -on: - push: - branches: [ master ] - -jobs: - lint: - runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - uses: wagoid/commitlint-github-action@master - with: - firstParent: false - failOnWarnings: true - - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name : GITHUB CONTEXT - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - - name: Setup .NET Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 3.1.101 - - - name: Start building Commit - run: echo ${{ github.event.head_commit.message }} - - - name: Build - run: dotnet build ./src/KafkaFlow.sln -c Release - - - name: UnitTest - run: dotnet test src/KafkaFlow.UnitTests/KafkaFlow.UnitTests.csproj -c Release - - - name: IntegrationTest - run: | - make init_broker - dotnet test src/KafkaFlow.IntegrationTests/KafkaFlow.IntegrationTests.csproj -c Release - make shutdown_broker - - release: - needs: build - runs-on: ubuntu-latest - if: startsWith(github.event.head_commit.message, 'feat') || startsWith(github.event.head_commit.message, 'fix') - - steps: - - uses: actions/checkout@v2 - - - name: Set Patch Bump - if: startsWith(github.event.head_commit.message, 'fix') - run: echo "::set-env name=DEFAULT_BUMP::patch" - - - name: Set Minor Bump - if: startsWith(github.event.head_commit.message, 'feat') - run: echo "::set-env name=DEFAULT_BUMP::minor" - - - name: Bump version and push tag - id: tagging - uses: anothrNick/github-tag-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - INITIAL_VERSION: 1.3.0 - - - name: Setup .NET Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 3.1.101 - - - name: Pack - run: dotnet pack ./src/KafkaFlow.sln -c Release /p:Version=${{ steps.tagging.outputs.new_tag }} -o ./drop - - - name: Publish - run: dotnet nuget push ./drop/**/*.nupkg -k ${{ secrets.NUGET_PUBLISH_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate - - - name: Print Version - run: echo ${{ steps.tagging.outputs.new_tag }} diff --git a/.github/workflows/build-pull-request.yml b/.github/workflows/build-pull-request.yml deleted file mode 100644 index 9f06a0213..000000000 --- a/.github/workflows/build-pull-request.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: Build Pull Request - -on: - pull_request: - branches: [ master ] - -jobs: - lint: - runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - uses: wagoid/commitlint-github-action@master - with: - firstParent: false - failOnWarnings: true - - build: - - runs-on: ubuntu-latest - outputs: - commit_message: ${{ steps.commit_message.outputs.message }} - - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Get Commit Message - id: commit_message - run: | - MSG=$(git log --format=%B -n 1 ${{github.event.pull_request.head.sha}}) - echo "::set-output name=message::${MSG}" - echo Commit Message: ${MSG} - - - name: GITHUB CONTEXT - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - - name: Setup .NET Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 3.1.101 - - - name: Build - run: dotnet build ./src/KafkaFlow.sln -c Release - - - name: UnitTest - run: dotnet test src/KafkaFlow.UnitTests/KafkaFlow.UnitTests.csproj -c Release - - - name: IntegrationTest - run: | - make init_broker - dotnet test src/KafkaFlow.IntegrationTests/KafkaFlow.IntegrationTests.csproj -c Release - make shutdown_broker - - release: - needs: build - runs-on: ubuntu-latest - if: startsWith(needs.build.outputs.commit_message, 'feat') || startsWith(needs.build.outputs.commit_message, 'fix') - - steps: - - uses: actions/checkout@v2 - - - name: Set Patch Bump - if: startsWith(needs.build.outputs.commit_message, 'fix') - run: echo "::set-env name=DEFAULT_BUMP::patch" - - - name: Set Minor Bump - if: startsWith(needs.build.outputs.commit_message, 'feat') - run: echo "::set-env name=DEFAULT_BUMP::minor" - - - name: Bump version and push tag - id: tagging - uses: anothrNick/github-tag-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - INITIAL_VERSION: 1.3.0 - PRERELEASE_SUFFIX: beta - - - name: Setup .NET Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 3.1.101 - - - name: Pack - run: dotnet pack ./src/KafkaFlow.sln -c Release /p:Version=${{ steps.tagging.outputs.new_tag }} -o ./drop - - - name: Publish - run: dotnet nuget push ./drop/**/*.nupkg -k ${{ secrets.NUGET_PUBLISH_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate - - - name: Print Version - run: echo ${{ steps.tagging.outputs.new_tag }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..83159790e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,48 @@ +name: Build + +on: + pull_request: + branches: [ master ] + + push: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name : GITHUB CONTEXT + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + + - name: Commit Lint + uses: wagoid/commitlint-github-action@master + with: + firstParent: false + failOnWarnings: true + + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.1.101 + + - name: Build + run: dotnet build ./src/KafkaFlow.sln -c Release + + - name: UnitTest + run: dotnet test src/KafkaFlow.UnitTests/KafkaFlow.UnitTests.csproj -c Release + + - name: IntegrationTest + run: | + make init_broker + dotnet test src/KafkaFlow.IntegrationTests/KafkaFlow.IntegrationTests.csproj -c Release + make shutdown_broker diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..c5f8ee55a --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,26 @@ +name: Publish + +on: + release: + types: [published] + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.1.101 + + - name: Pack + run: dotnet pack ./src/KafkaFlow.sln -c Release /p:Version=${{ github.event.release.tag_name }} -o ./drop + + - name: Publish + run: dotnet nuget push ./drop/**/*.nupkg -k ${{ secrets.NUGET_PUBLISH_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate + + - name: Print Version + run: echo ${{ github.event.release.tag_name }}