Skip to content

Commit

Permalink
ci: changes workflows to publish when a release is published
Browse files Browse the repository at this point in the history
  • Loading branch information
filipeesch committed Oct 6, 2020
1 parent a81e0ea commit 3cb9c4c
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 185 deletions.
88 changes: 0 additions & 88 deletions .github/workflows/build-master.yml

This file was deleted.

97 changes: 0 additions & 97 deletions .github/workflows/build-pull-request.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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
26 changes: 26 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit 3cb9c4c

Please sign in to comment.