Update gluon-release.yml #5
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
# Builds GraalVM 24-ea for Linux (x86_64), Windows (x86_64) and macOS (amd64/aarch64), with JDK 21 | |
name: Gluon Release | |
on: | |
push: | |
tags: | |
- '*' | |
env: | |
LANG: en_US.UTF-8 | |
jobs: | |
determine-version: | |
runs-on: ubuntu-latest | |
outputs: | |
simpleTag: ${{ steps.fetchSimpleTag.outputs.tag }} | |
version: ${{ steps.fetchVersion.outputs.version }} | |
steps: | |
- id: fetchSimpleTag | |
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} | |
- id: fetchVersion | |
run: echo ::set-output name=version::$(echo $GITHUB_REF | sed -E "s/.*(gluon-.*-(dev|Final)).*/\1/g") | |
build-graalvm-gluon: | |
needs: | |
- determine-version | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-13, macos-latest, ubuntu-latest] | |
include: | |
- os: ubuntu-latest | |
ARCH: "amd64" | |
HOME: "" | |
NAME: "linux" | |
- os: macos-13 | |
ARCH: "amd64" | |
HOME: "/Contents/Home" | |
NAME: "darwin" | |
- os: macos-latest | |
ARCH: "aarch64" | |
HOME: "/Contents/Home" | |
NAME: "darwin" | |
env: | |
LABS_LINK: https://github.com/graalvm/labs-openjdk/releases/download/23%2B25-jvmci-b01/ | |
LABS_TAG: 23+25-jvmci-b01 | |
LABS_HOME: ${{ github.workspace }}/jdk | |
MX_PYTHON: python3.9 | |
MX_PATH: ${{ github.workspace }}/mx | |
GRAALVM_SVM: graalvm-java23-${{ matrix.NAME }}-${{ matrix.ARCH }}-${{ needs.determine-version.outputs.version }} | |
DYNAMIC_IMPORTS: "/substratevm" | |
DISABLE_POLYGLOT: true | |
DISABLE_LIBPOLYGLOT: true | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- uses: actions/checkout@v4 | |
with: | |
repository: graalvm/mx | |
fetch-depth: 1 | |
ref: master | |
path: ${{ env.MX_PATH }} | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.mx | |
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }} | |
restore-keys: ${{ runner.os }}-mx- | |
- name: Set up Python | |
if: matrix.os == 'macos-13' || matrix.os == 'ubuntu-latest' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: Get LabsJDK | |
run: | | |
wget ${{ env.LABS_LINK }}labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz -O labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz | |
tar -xf labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz | |
echo "JAVA_HOME=${{ github.workspace }}/labsjdk-ce-23-jvmci-b01${{ matrix.HOME }}" >> ${GITHUB_ENV} | |
- name: Build GraalVM | |
run: | | |
cd substratevm | |
${MX_PATH}/mx --dy /substratevm --native-images=lib:native-image-agent build | |
echo "GRAALVM_HOME=`${MX_PATH}/mx --native-images=lib:native-image-agent graalvm-home`" >> ${GITHUB_ENV} | |
cd .. | |
- name: Create distribution | |
working-directory: ./vm | |
run: | | |
cd ${{ env.GRAALVM_HOME}}/.. | |
if [[ ${{ matrix.os }} != 'ubuntu-latest' ]] | |
then | |
cd ../.. | |
fi | |
mv `ls -1 | head -n1` ${{ env.GRAALVM_SVM }} | |
echo >> ${{ env.GRAALVM_SVM }}${{ matrix.HOME }}/release && echo "VENDOR=Gluon" >> ${{ env.GRAALVM_SVM }}${{ matrix.HOME }}/release | |
tar -czvf ${{ github.workspace }}/vm/${{ env.GRAALVM_SVM }}.tar.gz ${{ env.GRAALVM_SVM }} | |
- name: Archive distribution | |
uses: actions/upload-artifact@v4 | |
with: | |
name: graalvm-zip-${{ matrix.NAME }}-${{ matrix.ARCH }} | |
path: | | |
vm/${{ env.GRAALVM_SVM }}.tar.gz | |
build-graalvm-gluon-windows: | |
needs: | |
- determine-version | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest] | |
include: | |
- os: windows-latest | |
ARCH: "amd64" | |
HOME: "" | |
NAME: "windows" | |
env: | |
LABS_LINK: https://github.com/graalvm/labs-openjdk/releases/download/23%2B25-jvmci-b01/ | |
LABS_TAG: 23+25-jvmci-b01 | |
LABS_HOME: ${{ github.workspace }}/jdk | |
MX_PYTHON: 'python' | |
MX_PATH: ${{ github.workspace }}/mx | |
GRAALVM_SVM: graalvm-java23-${{ matrix.NAME }}-${{ matrix.ARCH }}-${{ needs.determine-version.outputs.version }} | |
DYNAMIC_IMPORTS: "/substratevm" | |
DISABLE_POLYGLOT: true | |
DISABLE_LIBPOLYGLOT: true | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- uses: actions/checkout@v4 | |
with: | |
repository: graalvm/mx | |
fetch-depth: 1 | |
ref: master | |
path: ${{ env.MX_PATH }} | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.mx | |
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }} | |
restore-keys: ${{ runner.os }}-mx- | |
- name: Get LabsJDK (windows) | |
run: | | |
Invoke-WebRequest ${{ env.LABS_LINK }}labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz -OutFile labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz | |
tar -xf .\labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz | |
- name: Build GraalVM (windows) | |
env: | |
JAVA_HOME: ${{ github.workspace }}/labsjdk-ce-23-jvmci-b01${{ matrix.HOME }} | |
shell: cmd | |
run: | | |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 | |
call ${{ env.MX_PATH }}\mx.cmd -p substratevm --dy /substratevm --native-images=lib:native-image-agent build | |
call ${{ env.MX_PATH }}\mx.cmd -p substratevm --native-images=lib:native-image-agent graalvm-home > graalvm-home-with-forward-slashes.txt | |
set /p GRAALVM_HOME=<graalvm-home-with-forward-slashes.txt | |
setlocal enabledelayedexpansion | |
set "GRAALVM_HOME=%GRAALVM_HOME:/=\%" | |
echo GRAALVM_HOME=%GRAALVM_HOME% >> %GITHUB_ENV% | |
- name: Create distribution | |
working-directory: ./vm | |
run: | | |
move ${{ env.GRAALVM_HOME}} ${{ env.GRAALVM_SVM }} | |
echo '' >> ${{ env.GRAALVM_SVM }}/release && echo VENDOR=Gluon >> ${{ env.GRAALVM_SVM }}/release | |
Compress-Archive -Path ${{ env.GRAALVM_SVM }} -DestinationPath ${{ env.GRAALVM_SVM }}.zip | |
- name: Archive distribution | |
uses: actions/upload-artifact@v4 | |
with: | |
name: graalvm-zip-${{ matrix.NAME }}-${{ matrix.ARCH }} | |
path: | | |
vm/${{ env.GRAALVM_SVM }}.zip | |
create-release: | |
runs-on: ubuntu-latest | |
needs: | |
- determine-version | |
- build-graalvm-gluon | |
- build-graalvm-gluon-windows | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: graalvm-zip-linux-amd64 | |
path: ./dist/vm | |
- uses: actions/download-artifact@v4 | |
with: | |
name: graalvm-zip-darwin-amd64 | |
path: ./dist/vm | |
- uses: actions/download-artifact@v4 | |
with: | |
name: graalvm-zip-darwin-aarch64 | |
path: ./dist/vm | |
- uses: actions/download-artifact@v4 | |
with: | |
name: graalvm-zip-windows-amd64 | |
path: ./dist/vm | |
- name: Check files | |
run: | | |
ls -R ./dist/vm | |
- name: Create release name | |
id: create-release-name | |
run: echo ::set-output name=releaseName::$(echo ${{ needs.determine-version.outputs.simpleTag }} | sed "s/gluon-/Gluon /g") | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: GraalVM CE ${{ steps.create-release-name.outputs.releaseName }} | |
body: | | |
This is a Gluon build of GraalVM. | |
Based on Gluon Graal commit: ${{ github.sha }} | |
files: | | |
./dist/vm/*.zip | |
./dist/vm/*.tar.gz |