Skip to content

Plugin Deployment #4249

Plugin Deployment

Plugin Deployment #4249

Workflow file for this run

# Note: additional setup is required, see https://www.jenkins.io/redirect/continuous-delivery-of-plugins
name: Plugin Deployment
on:
workflow_call:
inputs:
tag:
description: 'Jenkins tag name'
required: false
type: string
default: nightly
dev:
description: 'Is dev build'
required: false
default: true
type: boolean
workflow_dispatch:
inputs:
tag:
description: 'Jenkins tag name'
required: false
type: string
default: nightly
dev:
description: 'Is dev build'
required: false
default: true
type: boolean
check_run:
types:
- completed
jobs:
delete:
uses: jenkinsci/checkmarx-ast-scanner-plugin/.github/workflows/delete-dev-releases.yml@main
with:
tag: ${{ inputs.tag }}
secrets: inherit
if: inputs.dev
validate:
runs-on: ubuntu-latest
outputs:
should_release: ${{ (steps.verify-ci-status.outputs.result == 'success' && steps.interesting-categories.outputs.interesting == 'true') || inputs.dev == true || inputs.tag == 'nightly' }}
steps:
- name: Verify CI status
uses: jenkins-infra/verify-ci-status-action@7d194d0c5785a12623f350581db5243063542f90 #v1.2.2
id: verify-ci-status
if: inputs.dev == false || inputs.tag == 'nightly'
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
output_result: true
- name: Release Drafter
uses: release-drafter/release-drafter@v6
if: steps.verify-ci-status.outputs.result == 'success' && inputs.dev == false && inputs.tag != 'nightly'
with:
name: next
tag: next
version: next
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check interesting categories
uses: jenkins-infra/interesting-category-action@78f4b74509528c18790d9c36b2cccb5b21ed3451 #v1.2.1
id: interesting-categories
if: steps.verify-ci-status.outputs.result == 'success' || inputs.dev == false || inputs.tag != 'nightly'
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
runs-on: ubuntu-latest
needs: [validate]
if: needs.validate.outputs.should_release == 'true'
steps:
- name: Check out
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 8
uses: actions/[email protected]
with:
distribution: temurin
java-version: 11
- name: Release
uses: jenkins-infra/jenkins-maven-cd-action@5f5529707ac2bef1ff86da2553ce465ed669aa65 #v1.3.3
if: inputs.dev == false && inputs.tag != 'nightly'
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
- name: Upload Release Asset
id: upload-release-asset
uses: shogo82148/actions-upload-release-asset@c91b7fd867cf280772374042252f0dc8e1ade751 #v1
if: inputs.dev == false && inputs.tag != 'nightly'
env:
GITHUB_TOKEN: ${{ github.token}}
with:
github_token: ${{ github.token}}
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/checkmarx-ast-scanner.hpi
asset_name: checkmarx-ast-scanner.hpi
asset_content_type: application/multipart-core
overwrite: true
- name: mvn compile and package
if: inputs.dev == true || inputs.tag == 'nightly'
run: |
mvn package -DskipTests -Dset.changelist
- name: Create Release
uses: softprops/action-gh-release@3198ee18f814cdf787321b4a32a26ddbf37acc52 #v2.0.3
if: inputs.dev == true || inputs.tag == 'nightly'
env:
GITHUB_TOKEN: ${{ github.token}}
with:
name: ${{inputs.tag}}
tag_name: ${{inputs.tag}}
generate_release_notes: true
prerelease: true
files: target/checkmarx-ast-scanner.hpi