diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000..42d74c7 --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,47 @@ +# This workflow will build a Java project with Maven +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven + +name: Java CI Release with Maven + +on: + push: + tags: + - '*' + +jobs: + build: + name: Upload Release Asset + runs-on: ubuntu-latest + steps: + - name: Get the version + id: get_version + run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3) + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Maven Set Version + run: mvn versions:set -DnewVersion=${{ steps.get_version.outputs.VERSION }} -B --file pom.xml + - name: Build with Maven + 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: target/KeyToValueTransform-${{ steps.get_version.outputs.VERSION }}.jar + asset_name: kafka-connect-smt-KeyToValueTransform-${{ steps.get_version.outputs.VERSION }}.jar + asset_content_type: application/jar