Build Workflow -- main #3293
This file contains hidden or 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
| name: Build Workflow | |
| run-name: 'Build Workflow -- ${{ github.head_ref || github.ref_name }}' | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| env: | |
| BRANCH_NAME: ${{github.ref_name}} | |
| jobs: | |
| pr-verification: | |
| name: Pull Request Validation | |
| runs-on: ubuntu-24.04 | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - name: Pull Request Version Validation | |
| uses: ikmdev/maven-pull-request-version-validation-action@v4.0.1 | |
| get-args: | |
| name: Get Build Arguments | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| BUILD_NUMBER: ${{steps.getBuildNumberAndDate.outputs.BUILD_NUMBER}} | |
| DATE: ${{steps.getBuildNumberAndDate.outputs.DATE}} | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Get POM Version | |
| id: getPOMVERSSION | |
| run: echo "POM_VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT | |
| - name: Get Build Number And Date | |
| id: getBuildNumberAndDate | |
| run: | | |
| IFS='.' read -r major minor patch <<< "$POM_VERSION" | |
| echo "BUILD_NUMBER=$major.$minor.${{github.run_number}}" >> $GITHUB_OUTPUT | |
| echo "DATE=$(date +'%B %d %Y')" >> $GITHUB_OUTPUT | |
| env: | |
| POM_VERSION: ${{steps.getPOMVERSSION.outputs.POM_VERSION}} | |
| build-job: | |
| name: Build Job | |
| runs-on: ubuntu-24.04 | |
| needs: get-args | |
| steps: | |
| - name: Build IKMDEV Code | |
| uses: ikmdev/maven-clean-install-build-action@v4.0.1 | |
| with: | |
| branch_name: ${{env.BRANCH_NAME}} | |
| mvn_additional_args: '-Dbuild.version=${{needs.get-args.outputs.BUILD_NUMBER}} -Dbuild.time="${{needs.get-args.outputs.DATE}}"' | |
| generate_build_installers: | |
| name: Generate Snapshot Installers | |
| needs: build-job | |
| if: ${{!contains(github.ref_type, 'tag')}} | |
| strategy: | |
| matrix: | |
| os: [macos-15-intel, macos-15, ubuntu-24.04, windows-2022] | |
| runs-on: ${{matrix.os}} | |
| steps: | |
| - name: Checkout Code Repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '25' | |
| - name: Composite Action | |
| uses: ./.github/installer_composite | |
| with: | |
| branch_name: ${{ env.BRANCH_NAME }} | |
| isTag: "false" | |
| release_upload_url: ${{ '' }} | |
| github_token: ${{secrets.GITHUB_TOKEN}} | |
| operating_system: ${{matrix.os}} | |