Skip to content

Publish Maven Package #5

Publish Maven Package

Publish Maven Package #5

name: Publish Maven Package
on:
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true
type: string
release_name:
description: 'Release name'
required: true
type: string
is_draft:
description: 'Create a draft release'
required: false
default: 'false'
type: boolean
is_prerelease:
description: 'Create a pre-release'
required: false
default: 'false'
type: boolean
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Build with Maven
run: mvn clean package -B -V -e -Pspark3 -Pscala-2.12 -Phadoop3 -DskipTests -T1C
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
release_name: ${{ github.event.inputs.release_name }}
draft: ${{ github.event.inputs.is_draft }}
prerelease: ${{ github.event.inputs.is_prerelease }}
- name: 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: ./assembly/target/apache-livy-0.9.0-incubating-SNAPSHOT_2.12-bin.zip
asset_name: livy-0.9-snapshot.zip
asset_content_type: application/zip