Skip to content

Upgrade jdk-21 Windows builds to use MS VS2022 #2918

Upgrade jdk-21 Windows builds to use MS VS2022

Upgrade jdk-21 Windows builds to use MS VS2022 #2918

Workflow file for this run

---
name: Build
on:
pull_request:
branches: [master]
paths:
- "build-farm/**"
- "sbin/**"
- "**.sh"
- ".github/workflows/build.yml"
- "security/**"
- "cyclonedx-lib/**"
# Cancel existing runs if user makes another push.
concurrency:
group: "${{ github.ref }}"
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build_linux:
name: Linux
runs-on: ubuntu-latest
container:
image: ${{ matrix.image }}
strategy:
fail-fast: false
matrix:
os: [linux]
version: [jdk8u, jdk11u, jdk17u, jdk19u, jdk] #jdk head == jdk20
variant: [temurin]
image: [adoptopenjdk/centos7_build_image]
include:
- os: alpine-linux
version: jdk8u
variant: temurin
image: adoptopenjdk/alpine3_build_image
- os: alpine-linux
version: jdk11u
variant: temurin
image: adoptopenjdk/alpine3_build_image
- os: alpine-linux
version: jdk17u
variant: temurin
image: adoptopenjdk/alpine3_build_image
- os: alpine-linux
version: jdk19u
vm: temurin
image: adoptopenjdk/alpine3_build_image
- os: alpine-linux
version: jdk
variant: temurin
image: adoptopenjdk/alpine3_build_image
- os: linux
version: jdk11u
variant: dragonwell
image: adoptopenjdk/centos7_build_image
- os: linux
version: jdk8u
vm: dragonwell
image: adoptopenjdk/centos7_build_image
- os: linux
version: jdk11u
variant: fast_startup
image: adoptopenjdk/centos7_build_image
- os: linux
version: jdk11u
variant: bisheng
image: adoptopenjdk/centos7_build_image
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: Build Linux
run: ./build-farm/make-adopt-build-farm.sh
env:
JAVA_TO_BUILD: ${{ matrix.version }}
ARCHITECTURE: x64
VARIANT: ${{ matrix.variant }}
TARGET_OS: ${{ matrix.os }}
FILENAME: OpenJDK.tar.gz
# Don't set the OS as we use both linux and alpine-linux
PLATFORM_CONFIG_LOCATION: AdoptOpenJDK/openjdk-build/master/build-farm/platform-specific-configurations
BUILD_ARGS: --create-sbom
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
name: Collect and Archive Artifacts
with:
name: ${{matrix.version}}-${{matrix.os}}-${{matrix.variant}}
path: workspace/target/*
- name: Unpack jdk
run: |
mkdir -p "${HOME}/JDK"
tar -xf "${GITHUB_WORKSPACE}/workspace/target/OpenJDK.tar.gz" -C "${HOME}/JDK"
- name: Set root of jdk image dir
run: |
imageroot=$(find "${HOME}/JDK" -name release -type f)
echo "TEST_JDK_HOME=$(dirname "${imageroot}")" >> "$GITHUB_ENV"
- name: Smoke test
uses: adoptium/run-aqa@6bacb4e732ad546eda1b09665b9067cdc87651f4 # v2
with:
build_list: 'functional/buildAndPackage'
target: '_extended.functional'
vendor_testRepos: "${{ github.event.pull_request.head.repo.html_url }}.git"
vendor_testBranches: "${{ github.head_ref }}"
vendor_testDirs: "/test/functional"
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
name: Collect and Archive SmokeTest Results
if: failure()
with:
name: "${{matrix.version}}-${{matrix.os}}-${{matrix.variant}}_test_output"
path: ./**/output_*/
build_macos:
name: macOS
runs-on: macos-11
strategy:
fail-fast: false
matrix:
os: [macOS]
version: [jdk8u, jdk11u]
variant: [temurin]
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: Install Dependencies
run: |
brew install automake bash binutils freetype gnu-sed nasm
- uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0
id: setup-java
with:
java-version: 7
distribution: 'zulu'
if: matrix.version == 'jdk8u'
- name: Select correct Xcode
run: |
rm -rf /Applications/Xcode.app
ln -s /Applications/Xcode_11.7.app /Applications/Xcode.app
- name: Build macOS
run: |
export JAVA_HOME=$JAVA_HOME_11_X64
# Skip freetype build on jdk11+
if [ ${{ matrix.version }} != "jdk8u" ]; then
export BUILD_ARGS="--skip-freetype --make-exploded-image --create-sbom"
./build-farm/make-adopt-build-farm.sh
export BUILD_ARGS="--assemble-exploded-image --create-sbom"
./build-farm/make-adopt-build-farm.sh
else
export BUILD_ARGS="--create-sbom"
./build-farm/make-adopt-build-farm.sh
fi
env:
JAVA_TO_BUILD: ${{ matrix.version }}
ARCHITECTURE: x64
VARIANT: ${{ matrix.variant }}
TARGET_OS: mac
FILENAME: OpenJDK.tar.gz
JDK7_BOOT_DIR: ${{ steps.setup-java.outputs.path }}
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
name: Collect and Archive Artifacts
with:
name: ${{matrix.version}}-${{matrix.os}}-${{matrix.variant}}
path: workspace/target/*
- name: Unpack jdk
run: |
mkdir -p "${HOME}/JDK"
tar -xf "${GITHUB_WORKSPACE}/workspace/target/OpenJDK.tar.gz" -C "${HOME}/JDK"
- name: Set root of jdk image dir
run: |
imageroot=$(find "${HOME}/JDK" -name release -type f)
echo "TEST_JDK_HOME=$(dirname "${imageroot}")" >> "$GITHUB_ENV"
- name: Smoke test
uses: adoptium/run-aqa@6bacb4e732ad546eda1b09665b9067cdc87651f4 # v2
with:
build_list: 'functional/buildAndPackage'
target: '_extended.functional'
vendor_testRepos: "${{ github.event.pull_request.head.repo.html_url }}.git"
vendor_testBranches: "${{ github.head_ref }}"
vendor_testDirs: "/test/functional"
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
name: Collect and Archive SmokeTest Results
if: failure()
with:
name: "${{matrix.version}}-${{matrix.os}}-${{matrix.variant}}_test_output"
path: ./**/output_*/
build_windows:
name: Windows
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-2019]
version: [jdk8u, jdk11u, jdk17u, jdk]
variant: [temurin]
env:
VS2017_URL: "https://github.com/akashche/msvs_2017_installer_bootstrap/raw/master/vs_community__7955ddbf8a9b49dda0f8d18876e93bd2.exe"
steps:
- name: Restore cygwin packages from cache
id: cygwin
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: C:\cygwin64
key: cygwin-packages-${{ runner.os }}-v1
- name: Install Cygwin and packages
uses: cygwin/cygwin-install-action@006ad0b0946ca6d0a3ea2d4437677fa767392401
with:
install-dir: C:\cygwin64
packages: >-
autoconf,
automake,
bsdtar,
cpio,
curl,
gcc-core,
git,
gnupg,
grep,
libtool,
make,
mingw64-x86_64-gcc-core,
perl,
rsync,
unzip,
wget,
zip
- uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0
id: setup-java7
with:
distribution: 'zulu'
java-version: 7
if: matrix.version == 'jdk8u'
- uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0
id: setup-java11
with:
distribution: 'temurin'
java-version: 11
- name: Restore Visual Studio 2017 from cache
id: vs2017
if: matrix.version == 'jdk8u'
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ~/vs2017.exe
key: vs2017
- name: Uninstall WinSDKs
if: matrix.version == 'jdk8u'
run: >
Start-Process -FilePath 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe' -Wait -NoNewWindow -ArgumentList
'modify --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise"
--remove Microsoft.VisualStudio.Component.Windows10SDK.18362
--remove Microsoft.VisualStudio.Component.Windows10SDK.19041
--remove Microsoft.VisualStudio.Component.Windows10SDK.20348
--remove Microsoft.VisualStudio.Component.Windows10SDK.22000
--quiet'
- name: Download Visual Studio 2017
run: |
curl -L "$env:VS2017_URL" -o "$HOME/vs2017.exe"
if: steps.vs2017.outputs.cache-hit != 'true' && matrix.version == 'jdk8u'
- name: Install Visual Studio 2017
if: matrix.version == 'jdk8u'
run: >
Start-Process -FilePath "$HOME\vs2017.exe" -Wait -NoNewWindow -ArgumentList
'install --productId Microsoft.VisualStudio.Product.Community --channelId VisualStudio.15.Release
--add Microsoft.VisualStudio.Workload.NativeDesktop
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64
--add Microsoft.VisualStudio.Component.Windows10SDK.17763
--quiet --wait'
- name: Install Git
run: |
Invoke-WebRequest 'https://github.com/git-for-windows/git/releases/download/v2.14.3.windows.1/Git-2.14.3-64-bit.exe' -OutFile 'C:\temp\git.exe'
Start-Process -Wait -FilePath 'C:\temp\git.exe' -ArgumentList '/SILENT /ALLOWDOWNGRADE=1** /COMPONENTS="icons,ext\reg\shellhere,assoc,assoc_sh"'
- name: Set PATH
run: (printf "C:\cygwin64\bin;C:\Program Files\Git\bin;") | Out-File -FilePath "$env:GITHUB_PATH" -Encoding utf8 -Append
- name: Cygwin git configuration
shell: bash
run: mkdir -p "$HOME" && git config --system core.autocrlf false && git config --global --add safe.directory '*'
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
set-safe-directory: false
- name: Setup 8dot3name
run: fsutil behavior set disable8dot3 0
- name: Set JAVA_HOME
run: echo "JAVA_HOME=$(cygpath "${{ steps.setup-java11.outputs.path }}")" | Out-File -FilePath "$env:GITHUB_ENV" -Encoding utf8 -Append
- name: Set JDK7_BOOT_DIR
run: echo "JDK7_BOOT_DIR=$(cygpath "${{ steps.setup-java7.outputs.path }}")" | Out-File -FilePath "$env:GITHUB_ENV" -Encoding utf8 -Append
if: matrix.version == 'jdk8u'
- name: Hold ANT_HOME value (from GH) to ANT_HOME2
run: echo "ANT_HOME_ORIGIN=${env:ANT_HOME}" | Out-File -FilePath "$env:GITHUB_ENV" -Encoding utf8 -Append
- name: Export ANT to PATH(GITHUB_ENV)
run: echo "ANT_HOME=$(cygpath "${env:ANT_HOME}")" | Out-File -FilePath "$env:GITHUB_ENV" -Encoding utf8 -Append
- name: Append ANT_HOME to PATH
run: |
"${env:ANT_HOME}/bin" >> ${env:GITHUB_PATH}
shell: pwsh
- name: Build Windows
run: |
bash build-farm/make-adopt-build-farm.sh
shell: cmd
env:
JAVA_TO_BUILD: ${{ matrix.version }}
ARCHITECTURE: x64
VARIANT: ${{ matrix.variant }}
TARGET_OS: windows
FILENAME: OpenJDK.zip
BUILD_ARGS: --create-sbom
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
name: Collect and Archive Artifacts
with:
name: ${{matrix.version}}-${{matrix.os}}-${{matrix.variant}}
path: workspace/target/*
- name: Restore build artifacts
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: ${{matrix.version}}-${{matrix.os}}-${{matrix.variant}}
path: ~/${{matrix.version}}-${{matrix.os}}-${{matrix.variant}}
- name: Unpack jdk
run: |
unzip "${HOME}/${{matrix.version}}-${{matrix.os}}-${{matrix.variant}}/OpenJDK.zip" -d "${HOME}/${{matrix.version}}-${{matrix.os}}-${{matrix.variant}}"
- name: Set root of jdk image dir
shell: pwsh
run: |
$imageroot=$(find "${HOME}/${{matrix.version}}-${{matrix.os}}-${{matrix.variant}}" -name release -type f)
echo "TEST_JDK_HOME=$(dirname "${imageroot}")" | Out-File -FilePath "$env:GITHUB_ENV" -Encoding utf8 -Append
- name: Reset ANT_HOME from ANT_HOME_ORIGIN for smoke test
run: echo "ANT_HOME=${env:ANT_HOME_ORIGIN}" | Out-File -FilePath "$env:GITHUB_ENV" -Encoding utf8 -Append
- name: Smoke test
uses: adoptium/run-aqa@6bacb4e732ad546eda1b09665b9067cdc87651f4 # v2
with:
build_list: 'functional/buildAndPackage'
target: '_extended.functional'
vendor_testRepos: "${{ github.event.pull_request.head.repo.html_url }}.git"
vendor_testBranches: "${{ github.head_ref }}"
vendor_testDirs: "/test/functional"
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
name: Collect and Archive SmokeTest Results
if: failure()
with:
name: "${{matrix.version}}-${{matrix.os}}-${{matrix.variant}}_test_output"
path: ./**/output_*/