name: Create new release

on:
  push:
    branches:
      - master
    tags:
      - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Set up JDK 1.8
      uses: actions/setup-java@v1
      with:
        java-version: 1.8
    - name: Build with Maven
      id: build
      working-directory: kafka-connector
      run: mvn -B package --file pom.xml
    - name: Create Release
      id: create-release
      uses: actions/create-release@v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        tag_name: ${{ github.ref }}
        release_name: Release ${{ github.ref }}
        draft: false
        prerelease: false
    - name: Upload Release Asset
      id: upload-release-asset 
      uses: actions/upload-release-asset@v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        upload_url: ${{ steps.create-release.outputs.upload_url }}
        asset_path: ./kafka-connector/target/pubsub-kafka-connector.jar
        asset_name: pubsub-kafka-connector.jar
        asset_content_type: application/java-archive

Create new release github workflow
feat: Create new release github workflow

This will make a new release and build an uber-jar whenever a pr tagged 'v<something>' like 'v0.8.0' is merged into master.