diff --git a/.github/workflows/repackage_graalpy.yml b/.github/workflows/repackage_graalpy.yml index d3efe4aa..3167d0c5 100644 --- a/.github/workflows/repackage_graalpy.yml +++ b/.github/workflows/repackage_graalpy.yml @@ -1,115 +1,117 @@ -name: Repackage GraalPy - -on: - workflow_dispatch: - inputs: - graalpy_version: - required: true - type: string - platforms: - required: true - type: string - default: "linux-x86_64,linux-aarch64,macos,windows" - workflow_call: - inputs: - graalpy_version: - required: true - type: string - platforms: - required: true - type: string - -env: - image_map: '{"x86_64": "amd64/ubuntu:20.04", "aarch64": "arm64v8/ubuntu:20.04"}' - -jobs: - build_linux: - name: Linux ${{ inputs.graalpy_version }} ${{ matrix.arch }} - if: ${{ contains(inputs.platforms, 'linux') }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - arch: [x86_64, aarch64] - exclude: - - arch: ${{ !contains(inputs.platforms, 'linux-x86_64') && 'x86_64' || '' }} - - arch: ${{ !contains(inputs.platforms, 'linux-aarch64') && 'aarch64' || '' }} - - steps: - - name: Parse image - id: parse_image - run: | - IMAGE=$(echo ${{ toJSON(env.image_map) }} | jq -r '.["${{ matrix.arch }}"]') - echo "image=$IMAGE" >> "$GITHUB_OUTPUT" - - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Repackage - run: | - export DOCKER_IMAGE="${{ steps.parse_image.outputs.image }}" - ./scripts/repackage_graalpy.sh ${{ matrix.arch }} ${{ inputs.graalpy_version }} linux - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: graalpy-linux-${{ matrix.arch }}-${{ inputs.graalpy_version }} - path: ./graalpy*.zip - - build_windows: - name: Windows ${{ inputs.graalpy_version }} x86_64 - if: ${{ contains(inputs.platforms, 'windows') }} - runs-on: windows-latest - - steps: - - name: Set git to use LF - run: | - git config --global core.autocrlf false - git config --global core.eol lf - - - name: Checkout - uses: actions/checkout@v4 - - - name: Repackage - shell: bash - run: | - set -ex - ./scripts/repackage_graalpy.sh x86_64 ${{ inputs.graalpy_version }} windows - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: graalpy-windows-x86_64-${{ inputs.graalpy_version }} - path: ./graalpy*.zip - - build_macos: - name: MacOS ${{ inputs.graalpy_version }} ${{ matrix.arch }} - if: ${{ contains(inputs.platforms, 'macos') }} - runs-on: ${{ matrix.runner }} - strategy: - fail-fast: false - matrix: - arch: [x86_64, aarch64] - include: - - arch: x86_64 - runner: macos-12 - - arch: aarch64 - runner: macos-14 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Repackage - run: | - set -ex - ./scripts/repackage_graalpy.sh ${{ matrix.arch }} ${{ inputs.graalpy_version }} darwin - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: graalpy-darwin-${{ matrix.arch }}-${{ inputs.graalpy_version }} +name: Repackage GraalPy + +on: + workflow_dispatch: + inputs: + graalpy_version: + required: true + type: string + platforms: + required: true + type: string + default: "linux-x86_64,linux-aarch64,macos,windows" + workflow_call: + inputs: + graalpy_version: + required: true + type: string + platforms: + required: true + type: string + +env: + image_map: '{"x86_64": "amd64/ubuntu:20.04", "aarch64": "arm64v8/ubuntu:20.04"}' + +jobs: + build_linux: + name: Linux ${{ inputs.graalpy_version }} ${{ matrix.distribution }} ${{ matrix.arch }} + if: ${{ contains(inputs.platforms, 'linux') }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + arch: [x86_64, aarch64] + distribution: [standard, jvm, community, community-jvm] + exclude: + - arch: ${{ !contains(inputs.platforms, 'linux-x86_64') && 'x86_64' || '' }} + - arch: ${{ !contains(inputs.platforms, 'linux-aarch64') && 'aarch64' || '' }} + + steps: + - name: Parse image + id: parse_image + run: | + IMAGE=$(echo ${{ toJSON(env.image_map) }} | jq -r '.["${{ matrix.arch }}"]') + echo "image=$IMAGE" >> "$GITHUB_OUTPUT" + + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Repackage + run: | + export DOCKER_IMAGE="${{ steps.parse_image.outputs.image }}" + export MATRIX_DISTRIBUTION="${{ matrix.distribution }}" + ./scripts/repackage_graalpy.sh ${{ matrix.arch }} ${{ inputs.graalpy_version }} linux + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: graalpy-linux-${{ matrix.distribution }}-${{ matrix.arch }}-${{ inputs.graalpy_version }} + path: ./graalpy*.zip + + build_windows: + name: Windows ${{ inputs.graalpy_version }} x86_64 + if: ${{ contains(inputs.platforms, 'windows') }} + runs-on: windows-latest + + steps: + - name: Set git to use LF + run: | + git config --global core.autocrlf false + git config --global core.eol lf + + - name: Checkout + uses: actions/checkout@v4 + + - name: Repackage + shell: bash + run: | + set -ex + ./scripts/repackage_graalpy.sh x86_64 ${{ inputs.graalpy_version }} windows + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: graalpy-windows-x86_64-${{ inputs.graalpy_version }} + path: ./graalpy*.zip + + build_macos: + name: MacOS ${{ inputs.graalpy_version }} ${{ matrix.arch }} + if: ${{ contains(inputs.platforms, 'macos') }} + runs-on: ${{ matrix.runner }} + strategy: + fail-fast: false + matrix: + arch: [x86_64, aarch64] + include: + - arch: x86_64 + runner: macos-12 + - arch: aarch64 + runner: macos-14 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Repackage + run: | + set -ex + ./scripts/repackage_graalpy.sh ${{ matrix.arch }} ${{ inputs.graalpy_version }} darwin + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: graalpy-darwin-${{ matrix.arch }}-${{ inputs.graalpy_version }} path: ./graalpy*.zip \ No newline at end of file diff --git a/scripts/repackage_graalpy.sh b/scripts/repackage_graalpy.sh index afba169e..21817846 100755 --- a/scripts/repackage_graalpy.sh +++ b/scripts/repackage_graalpy.sh @@ -93,7 +93,15 @@ function repackage_graal () { echo "::endgroup::" } -repackage_graal -repackage_graal jvm -repackage_graal community -repackage_graal community-jvm \ No newline at end of file +if [[ "${PLATFORM}" == "linux" ]]; then + if [[ "${MATRIX_DISTRIBUTION}" == "standard" ]]; then + repackage_graal + else + repackage_graal "${MATRIX_DISTRIBUTION}" + fi +else + repackage_graal + repackage_graal jvm + repackage_graal community + repackage_graal community-jvm +fi \ No newline at end of file