Skip to content

Commit

Permalink
Update build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
RealCLanger committed Mar 28, 2024
1 parent b1d480a commit 1c2b75b
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
commit: ${{ steps.buildcheck.outputs.commit }}
steps:
- name: Checkout JMC
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.gitRef }}

Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
echo "agentVersion=$(echo $AGENT_VERSION)" >> $GITHUB_OUTPUT
- name: Download existing release file
uses: robinraju/release-downloader@v1
uses: robinraju/release-downloader@v1.9
continue-on-error: true
with:
tag: ${{ steps.versions.outputs.githubRelease }}
Expand Down Expand Up @@ -133,43 +133,38 @@ jobs:
echo doBuild: ${{ needs.parameters.outputs.doBuild }}
echo commit: ${{ needs.parameters.outputs.commit }}
deleteold:
name: Delete old Release
needs: parameters
if: ${{ needs.parameters.outputs.doBuild == 'true' && needs.parameters.outputs.publish == 'true' && needs.parameters.outputs.release != 'true' }}
build:
name: Build JMC
needs: [parameters]
if: needs.parameters.outputs.doBuild == 'true'
runs-on: ubuntu-latest
env:
MAVEN_OPTS: -Xmx2048m
MAVEN_CALL: mvn --batch-mode --no-transfer-progress
steps:
- name: Delete old GitHub release ${{ needs.parameters.outputs.githubRelease }}
if: ${{ needs.parameters.outputs.publish == 'true' && needs.parameters.outputs.release != 'true' }}
continue-on-error: true
uses: dev-drprasad/[email protected]
with:
tag_name: ${{ needs.parameters.outputs.githubRelease }}
github_token: ${{ secrets.GITHUB_TOKEN }}

build:
name: Build JMC
needs: [parameters, deleteold]
if: needs.parameters.outputs.doBuild == 'true'
runs-on: ubuntu-latest
env:
MAVEN_OPTS: -Xmx2048m
MAVEN_CALL: mvn --batch-mode --no-transfer-progress
steps:
- name: Checkout JMC
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ needs.parameters.outputs.commit }}

- name: Set up build JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
java-package: jdk
mvn-toolchain-id: 'JavaSE-17'

- name: Cache local Maven repository
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand Down

0 comments on commit 1c2b75b

Please sign in to comment.