Skip to content

Build

Build #594

Workflow file for this run

name: Build
on:
schedule:
- cron: '0 18 * * *'
workflow_dispatch:
inputs:
release:
description: 'Set to True if are running a release'
required: true
default: 'False'
releaseTag:
description: 'Set the release tag'
required: true
default: '9.0.0-SNAPSHOT'
checkoutRef:
description: 'JMC Checkout reference'
required: true
default: 'master'
version:
description: 'If running a release, set the version e.g (9.0.0-SNAPSHOT)'
required: true
default: '9.0.0-SNAPSHOT'
agentVersion:
description: 'If running a release, set the agent version e.g (1.0.1-SNAPSHOT)'
required: true
default: '1.0.1-SNAPSHOT'
jobs:
release:
name: Update release
runs-on: ubuntu-latest
outputs:
release: ${{ github.event.inputs.release || 'True' }}
releaseTag: ${{ github.event.inputs.releaseTag || '9.0.0-SNAPSHOT' }}
checkoutRef: ${{ github.event.inputs.checkoutRef || 'master' }}
version: ${{ github.event.inputs.version || '9.0.0-SNAPSHOT' }}
agentVersion: ${{ github.event.inputs.agentVersion || '1.0.1-SNAPSHOT' }}
steps:
- name: info
run: echo Initialize outputs...
build:
if: always()
needs: release
name: Build
runs-on: ubuntu-latest
env:
MAVEN_OPTS: -Xmx2048m -Declipse.p2.mirrors=false
steps:
- name: Checkout JMC
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: openjdk/jmc
ref: ${{ needs.release.outputs.checkoutRef }}
- name: Create release.txt
run: git rev-parse HEAD > release.txt
- name: Checkout JMC Overrides
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: workspace
- name: Create .m2/settings.xml
run: |
mkdir .m2
cp workspace/.github/workflows/settings.xml .m2/settings.xml
- name: Apply overrides
run: cp workspace/overrides/* . -rvf
- name: Change to final version
if: ${{ ! endsWith(needs.release.outputs.version, '-SNAPSHOT') }}
run: |
find . ! -path "*/.git/**" -type f -name "pom.xml" -exec sed -i s/"${{ needs.release.outputs.version }}-SNAPSHOT"/"${{ needs.release.outputs.version }}"/ {} \;
find . ! -path "*/.git/**" -type f \( -name "feature.xml" -o -name "MANIFEST.MF" \) -exec sed -i s/"${{ needs.release.outputs.version }}.qualifier"/"${{ needs.release.outputs.version }}"/ {} \;
echo "MAVEN_OPTS=$MAVEN_OPTS -DskipNexusStagingDeployMojo=true -Dchangelist=" >> $GITHUB_ENV
- name: Set up JDK 17
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0
with:
java-version: 17
distribution: temurin
cache: 'maven'
mvn-toolchain-id: 'JavaSE-17'
- name: Build & test core libraries
run: |
mvn verify
mvn install
working-directory: core
- name: Deploy core libraries
if: needs.release.outputs.release == 'True'
run: |
mvn deploy --settings $GITHUB_WORKSPACE/.m2/settings.xml -Dpublish.user=$USERNAME -Dpublish.password=$PASSWORD -Drelease.repo=https://adoptium.jfrog.io/artifactory/jmc-libs -Dsnapshot.repo=https://adoptium.jfrog.io/artifactory/jmc-libs-snapshots -Dgpg.skip=true -DskipTests=true
env:
USERNAME: ${{ secrets.ARTIFACTORY_USER }}
PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
working-directory: core
- name: Build & test agent
run: |
mvn verify
mvn install
working-directory: agent
- name: Deploy agent libraries
if: needs.release.outputs.release == 'True'
run: |
mvn deploy --settings $GITHUB_WORKSPACE/.m2/settings.xml -Dpublish.user=$USERNAME -Dpublish.password=$PASSWORD -Drelease.repo=https://adoptium.jfrog.io/artifactory/jmc-libs -Dsnapshot.repo=https://adoptium.jfrog.io/artifactory/jmc-libs-snapshots -Dgpg.skip=true -DskipTests=true
env:
USERNAME: ${{ secrets.ARTIFACTORY_USER }}
PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
working-directory: agent
- name: Build
run: |
mvn clean
mvn p2:site
mvn jetty:run &
cd ../../
mvn package
working-directory: releng/third-party
- name: Run Unit Tests
uses: GabrielBB/xvfb-action@86d97bde4a65fe9b290c0b3fb92c2c4ed0e5302d # v1.6
with:
run: mvn verify
- name: Run UI Tests
# Ignore UI failures for now
continue-on-error: true
uses: GabrielBB/xvfb-action@86d97bde4a65fe9b290c0b3fb92c2c4ed0e5302d # v1.6
with:
run: mvn verify -P uitests
- name: Deploy update sites
if: needs.release.outputs.release == 'True'
run: |
curl -X DELETE -u "$USERNAME:$PASSWORD" https://adoptium.jfrog.io/artifactory/jmc-snapshots/ide
find . -type f -exec curl -o /dev/null -s -u "$USERNAME:$PASSWORD" -T \'{}\' https://adoptium.jfrog.io/artifactory/jmc-snapshots/ide/\'{}\' \;
env:
USERNAME: ${{ secrets.ARTIFACTORY_USER }}
PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
working-directory: application/org.openjdk.jmc.updatesite.ide/target/repository
- if: needs.release.outputs.release == 'True'
name: Delete old linux assets from ${{ needs.release.outputs.releaseTag }}
uses: mknejp/delete-release-assets@v1
with:
token: ${{ github.token }}
tag: ${{ needs.release.outputs.releaseTag }}
assets: |
release*
agent-*
org.openjdk.jmc.updatesite.ide-*
org.openjdk.jmc-*.x86_64.*
fail-if-no-assets: false
fail-if-no-release: false
- if: needs.release.outputs.release == 'True'
name: Upload release-${{ needs.release.outputs.agentVersion }}.txt
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # v2.7.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.release.outputs.releaseTag }}
file: release.txt
asset_name: release-${{ needs.release.outputs.version }}.txt
overwrite: true
- if: needs.release.outputs.release == 'True'
name: Upload agent-${{ needs.release.outputs.agentVersion }}.jar
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # v2.7.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.release.outputs.releaseTag }}
file: agent/target/agent-${{ needs.release.outputs.agentVersion }}.jar
asset_name: agent-${{ needs.release.outputs.agentVersion }}.jar
overwrite: true
- if: needs.release.outputs.release == 'True'
name: Upload org.openjdk.jmc.updatesite.ide-${{ needs.release.outputs.version }}.zip
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # v2.7.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.release.outputs.releaseTag }}
file: application/org.openjdk.jmc.updatesite.ide/target/org.openjdk.jmc.updatesite.ide-${{ needs.release.outputs.version }}.zip
asset_name: org.openjdk.jmc.updatesite.ide-${{ needs.release.outputs.version }}.zip
overwrite: true
- if: needs.release.outputs.release == 'True'
name: Upload org.openjdk.jmc-linux.gtk.x86_64.tar.gz
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # v2.7.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.release.outputs.releaseTag }}
file: target/products/org.openjdk.jmc-linux.gtk.x86_64.tar.gz
asset_name: org.openjdk.jmc-${{ needs.release.outputs.version }}-linux.gtk.x86_64.tar.gz
overwrite: true
- if: needs.release.outputs.release == 'True'
name: Upload org.openjdk.jmc-linux.gtk.aarch64.tar.gz
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # v2.7.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.release.outputs.releaseTag }}
file: target/products/org.openjdk.jmc-linux.gtk.aarch64.tar.gz
asset_name: org.openjdk.jmc-${{ needs.release.outputs.version }}-linux.gtk.aarch64.tar.gz
overwrite: true
- if: needs.release.outputs.release == 'True'
name: Upload org.openjdk.jmc-macosx.cocoa.x86_64.tar.gz
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # v2.7.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.release.outputs.releaseTag }}
file: target/products/org.openjdk.jmc-macosx.cocoa.x86_64.tar.gz
asset_name: org.openjdk.jmc-${{ needs.release.outputs.version }}-macosx.cocoa.x86_64.tar.gz
overwrite: true
- if: needs.release.outputs.release == 'True'
name: Upload org.openjdk.jmc-macosx.cocoa.aarch64.tar.gz
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # v2.7.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.release.outputs.releaseTag }}
file: target/products/org.openjdk.jmc-macosx.cocoa.aarch64.tar.gz
asset_name: org.openjdk.jmc-${{ needs.release.outputs.version }}-macosx.cocoa.aarch64.tar.gz
overwrite: true
- if: needs.release.outputs.release == 'True'
name: Upload org.openjdk.jmc-win32.win32.x86_64.zip
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # v2.7.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.release.outputs.releaseTag }}
file: target/products/org.openjdk.jmc-win32.win32.x86_64.zip
asset_name: org.openjdk.jmc-${{ needs.release.outputs.version }}-win32.win32.x86_64.zip
overwrite: true