diff --git a/.github/workflows/mvnMainMerge.yml b/.github/workflows/mvnMainMerge.yml new file mode 100644 index 0000000..eea586f --- /dev/null +++ b/.github/workflows/mvnMainMerge.yml @@ -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 diff --git a/.github/workflows/mvnPRCreated.yml b/.github/workflows/mvnPRCreated.yml new file mode 100644 index 0000000..b4e3793 --- /dev/null +++ b/.github/workflows/mvnPRCreated.yml @@ -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 \ No newline at end of file diff --git a/pom.xml b/pom.xml index 50055f5..96b7d5a 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ 4.0.0 com.hcl.devops hcl-accelerate - 2.1.4-SNAPSHOT + 2.1.4 hpi HCL Accelerate Plugin This plugin can run Jenkins jobs as a part of a deployment plan in HCL Accelerate.