Skip to content

Commit

Permalink
Merge pull request #2 from deuscapturus/master
Browse files Browse the repository at this point in the history
Add workflow that will build jar and add as a release
  • Loading branch information
jzaralim authored Oct 24, 2021
2 parents a1ee742 + 4b70f55 commit a8e0cb7
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a8e0cb7

Please sign in to comment.