Plugin Deployment #5814
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348 #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@8f032eff0255912cc9c8455797fd6d72f25c7ab7 #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@a74c6b72af54cfa997e81df42d94703d6313a2d0 #v2.0.6 | |
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 |