Update SDK version used by WiX installer to one that we install with VS2022 #293
Workflow file for this run
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
name: Windows | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [master] | |
paths: | |
- .github/workflows/wix.yml | |
- wix/** | |
permissions: | |
contents: read | |
jobs: | |
wix: | |
strategy: | |
fail-fast: false | |
matrix: | |
jdk: [8, 11, 17, 21] | |
arch: [x64] | |
jvm: [hotspot] | |
include: | |
- jdk: 8 | |
ICEDTEA_WEB_VERSION: "icedtea-web-1.8.8" | |
- jdk: 11 | |
arch: x86-32 | |
jvm: hotspot | |
name: wix | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Install wix toolset | |
run: dotnet tool install --global wix --version 5.0.0 --verbosity quiet | |
- name: Fetch latest Windows version from Adoptium API | |
run: | | |
$response = Invoke-WebRequest -Uri "https://api.adoptium.net/v3/assets/feature_releases/${{ matrix.jdk }}/ga?architecture=x64&image_type=jdk&os=windows&page=0&page_size=1" -UseBasicParsing | |
$json = $response.Content | ConvertFrom-Json | |
$major = $json.version_data.major | |
$minor = $json.version_data.minor | |
$security = $json.version_data.security | |
$patch = 0 | |
$build = $json.version_data.build | |
echo "PRODUCT_MAJOR_VERSION=$major" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | |
echo "PRODUCT_MINOR_VERSION=$minor" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | |
echo "PRODUCT_MAINTENANCE_VERSION=$security"| Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | |
echo "PRODUCT_PATCH_VERSION=$patch" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | |
# if jdk8 and build is a single digit, add a 0 to the front | |
if ($major -eq 8 -and $build -lt 10) { | |
echo "PRODUCT_BUILD_NUMBER=0$build" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | |
} else { | |
echo "PRODUCT_BUILD_NUMBER=$build" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | |
} | |
echo "MSI_PRODUCT_VERSION=$major.$minor.$security.$build" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | |
echo "TAG=$($json.release_name)" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | |
# SUB_TAG is used to create the file name of the JDK/JRE zip file | |
# For jdk8 strip the jdk and the - from the release name | |
if ($major -eq 8) { | |
$subTag = $json.release_name -replace "jdk", "" | |
$subTag = $subTag -replace "-", "" | |
# For JDK9 and above remove jdk- and replace + with _ | |
} else { | |
$subTag = $json.release_name -replace "jdk-", "" | |
$subTag = $subTag -replace "\+", "_" | |
} | |
echo "SUB_TAG=$subTag" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Download IcedTea-Web | |
run: | | |
Invoke-WebRequest -Uri "https://github.com/AdoptOpenJDK/IcedTea-Web/releases/download/${{ matrix.ICEDTEA_WEB_VERSION }}/${{ matrix.ICEDTEA_WEB_VERSION }}.win.bin.zip" ` | |
-OutFile "${{ matrix.ICEDTEA_WEB_VERSION }}.win.bin.zip" | |
unzip -q icedtea-web-*.win.bin.zip | |
Remove-Item icedtea-web-*.win.bin.zip | |
Remove-Item icedtea-web-image\share\doc -Recurse | |
working-directory: wix/SourceDir | |
if: ${{ matrix.ICEDTEA_WEB_VERSION }} | |
- name: Download Prebuilt JDK/JRE | |
run: | | |
Invoke-WebRequest -Uri "https://github.com/adoptium/temurin${{ env.PRODUCT_MAJOR_VERSION }}-binaries/releases/download/${{ env.TAG }}/OpenJDK${{ env.PRODUCT_MAJOR_VERSION }}U-jdk_${{ matrix.ARCH }}_windows_${{ matrix.JVM }}_${{ env.SUB_TAG }}.zip" ` | |
-OutFile "OpenJDK${{ env.PRODUCT_MAJOR_VERSION }}U-jdk_${{ matrix.ARCH }}_windows_${{ matrix.JVM }}_${{ env.SUB_TAG }}.zip" | |
Invoke-WebRequest -Uri "https://github.com/adoptium/temurin${{ env.PRODUCT_MAJOR_VERSION }}-binaries/releases/download/${{ env.TAG }}/OpenJDK${{ env.PRODUCT_MAJOR_VERSION }}U-jre_${{ matrix.ARCH }}_windows_${{ matrix.JVM }}_${{ env.SUB_TAG }}.zip" ` | |
-OutFile "OpenJDK${{ env.PRODUCT_MAJOR_VERSION }}U-jre_${{ matrix.ARCH }}_windows_${{ matrix.JVM }}_${{ env.SUB_TAG }}.zip" | |
./CreateSourceFolder.AdoptOpenJDK.ps1 | |
working-directory: wix/SourceDir | |
- name: Create JDK Installer | |
run: call Build.OpenJDK_generic.cmd | |
working-directory: wix | |
env: | |
PRODUCT_CATEGORY: jdk | |
ARCH: ${{ matrix.ARCH }} | |
JVM: ${{ matrix.JVM }} | |
shell: cmd | |
- name: Create JRE Installer | |
run: call Build.OpenJDK_generic.cmd | |
working-directory: wix | |
env: | |
PRODUCT_CATEGORY: jre | |
ARCH: ${{ matrix.ARCH }} | |
JVM: ${{ matrix.JVM }} | |
shell: cmd | |
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: windows-${{ env.PRODUCT_MAJOR_VERSION }}-${{ matrix.arch }} | |
path: wix/ReleaseDir/*.msi |