Skip to content

Commit

Permalink
Merge pull request #2 from lalitKumarHCL/Build-Actions
Browse files Browse the repository at this point in the history
Created maven.yml
  • Loading branch information
lalitKumarHCL authored Nov 10, 2021
2 parents 3838970 + c24552b commit 58ee47d
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 1 deletion.
61 changes: 61 additions & 0 deletions .github/workflows/mvnMainMerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Maven Main Build and Release Artifact

on:
push:
branches: [ main ]

jobs:
build-project:
name: Build Artifact
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Extract GAV
id: extract
uses: andreacomo/maven-gav-extractor@v1
- name: Log GAV
run: |
echo ${{ steps.extract.outputs.group-id }}
echo ${{ steps.extract.outputs.artifact-id }}
echo ${{ steps.extract.outputs.version }}
shell: bash
- name: Upload Build Artifact
uses: actions/upload-artifact@v2
with:
name: ${{ steps.extract.outputs.artifact-id }}-${{ steps.extract.outputs.version }}
path: /home/runner/work/hcl-accelerate-plugin/hcl-accelerate-plugin/target/hcl-accelerate.hpi

- name: Download site content
uses: actions/download-artifact@v2
with:
name: ${{ steps.extract.outputs.artifact-id }}-${{ steps.extract.outputs.version }}
- name: Create GitHub release
id: create-new-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.extract.outputs.version }}
release_name: ${{ steps.extract.outputs.artifact-id }}-${{ steps.extract.outputs.version }}
- name: View content
run: ls -R
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-new-release.outputs.upload_url }}
asset_path: /home/runner/work/hcl-accelerate-plugin/hcl-accelerate-plugin/target/hcl-accelerate.hpi
asset_name: ${{ steps.extract.outputs.artifact-id }}-${{ steps.extract.outputs.version }}.hpi
asset_content_type: application/zip
37 changes: 37 additions & 0 deletions .github/workflows/mvnPRCreated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Maven Pull Request Build

on:
pull_request:
branches: [ main ]

jobs:
build-project:
name: Build Artifact
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Extract GAV
id: extract
uses: andreacomo/maven-gav-extractor@v1
- name: Log GAV
run: |
echo ${{ steps.extract.outputs.group-id }}
echo ${{ steps.extract.outputs.artifact-id }}
echo ${{ steps.extract.outputs.version }}
shell: bash
- name: Upload Build Artifact
uses: actions/upload-artifact@v2
with:
name: ${{ steps.extract.outputs.artifact-id }}-${{ steps.extract.outputs.version }}
path: /home/runner/work/hcl-accelerate-plugin/hcl-accelerate-plugin/target/hcl-accelerate.hpi
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.hcl.devops</groupId>
<artifactId>hcl-accelerate</artifactId>
<version>2.1.4-SNAPSHOT</version>
<version>2.1.4</version>
<packaging>hpi</packaging>
<name>HCL Accelerate Plugin</name>
<description>This plugin can run Jenkins jobs as a part of a deployment plan in HCL Accelerate.</description>
Expand Down

0 comments on commit 58ee47d

Please sign in to comment.