Merge pull request #772 from TransactionProcessing/task/#770_aggregat… #166
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Pre-Release Nugets and Docker | |
| on: | |
| push: | |
| # branches to consider in the event; optional, defaults to all | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| name: "Publish Pre-Release Nugets and Docker" | |
| env: | |
| ASPNETCORE_ENVIRONMENT: "Production" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2.3.4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Restore Nuget Packages | |
| run: dotnet restore TransactionProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} | |
| - name: Build Code | |
| run: dotnet build TransactionProcessor.sln --configuration Release | |
| - name: 'Get Previous tag' | |
| id: get-latest-tag | |
| uses: actions-ecosystem/action-get-latest-tag@v1 | |
| with: | |
| semver_only: true | |
| - name: 'Bump Version' | |
| id: bump-semver | |
| uses: actions-ecosystem/action-bump-semver@v1 | |
| with: | |
| current_version: ${{ steps.get-latest-tag.outputs.tag }} | |
| level: patch | |
| - name: Print Version | |
| id: next_version | |
| run: echo ::set-output name=VERSION::${{ steps.bump-semver.outputs.new_version }}-build$GITHUB_RUN_NUMBER | |
| - name: Build and Publish Nuget Packages | |
| run: | | |
| dotnet pack "TransactionProcessor.Client\TransactionProcessor.Client.csproj" /p:PackageVersion=${{ steps.next_version.outputs.VERSION }} --output Nugets | |
| dotnet nuget push Nugets/TransactionProcessor.Client.${{ steps.next_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.PRIVATEFEED_APIKEY }} --source ${{ secrets.PRIVATEFEED_URL }} | |
| dotnet pack "TransactionProcessor.DomainEvents\TransactionProcessor.DomainEvents.csproj" /p:PackageVersion=${{ steps.next_version.outputs.VERSION }} --output Nugets | |
| dotnet nuget push Nugets/TransactionProcessor.DomainEvents.${{ steps.next_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.PRIVATEFEED_APIKEY }} --source ${{ secrets.PRIVATEFEED_URL }} | |
| dotnet pack "TransactionProcessor.IntegrationTesting.Helpers\TransactionProcessor.IntegrationTesting.Helpers.csproj" /p:PackageVersion=${{ steps.next_version.outputs.VERSION }} --output Nugets | |
| dotnet nuget push Nugets/TransactionProcessor.IntegrationTesting.Helpers.${{ steps.next_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.PRIVATEFEED_APIKEY }} --source ${{ secrets.PRIVATEFEED_URL }} | |
| dotnet pack "TransactionProcessor.Database\TransactionProcessor.Database.csproj" /p:PackageVersion=${{ steps.next_version.outputs.VERSION }} --output Nugets -c Release | |
| dotnet nuget push Nugets/TransactionProcessor.Database.${{ steps.next_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.PRIVATEFEED_APIKEY }} --source ${{ secrets.PRIVATEFEED_URL }} | |
| - name: Publish Images to Docker Hub | |
| run: | | |
| docker build . --file TransactionProcessor/Dockerfile --tag stuartferguson/transactionprocessor:master | |
| docker login --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }} | |
| docker push stuartferguson/transactionprocessor:master | |
| buildwidows: | |
| name: "Publish Pre-Release Docker for Windows" | |
| env: | |
| ASPNETCORE_ENVIRONMENT: "Production" | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v2.3.4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Publish Windows Images to Docker Hub | |
| run: | | |
| docker build . --file TransactionProcessor/Dockerfilewindows --tag stuartferguson/transactionprocessorwindows:master | |
| docker login --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }} | |
| docker push stuartferguson/transactionprocessorwindows:master |