Skip to content

Build and publish GraalPy #8

Build and publish GraalPy

Build and publish GraalPy #8

name: Build and publish GraalPy
on:
workflow_dispatch:
inputs:
graalpy_version:
required: true
type: string
beta:
required: false
type: boolean
default: false
workflow_call:
inputs:
graalpy_version:
required: true
type: string
beta:
required: false
type: boolean
default: false
jobs:
build:
name: Build GraalPy ${{ inputs.graalpy_version }}
uses: ./.github/workflows/repackage_graalpy.yml
with:
graalpy_version: ${{ inputs.graalpy_version }}
platforms: "linux-x86_64,linux-aarch64,macos,windows"
publish:
name: Publish GraalPy ${{ inputs.graalpy_version }}
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get tags
run: git fetch --tags origin
- name: Download artifact
uses: actions/download-artifact@v4
with:
pattern: graalpy-*
path: /tmp/graalpy/
merge-multiple: true
- name: Get latest
run: |
echo "LATEST_TAG=$(./scripts/pick_semver.sh ${{ inputs.graalpy_version }} ${{ inputs.beta }} graalpy true)" >> $GITHUB_ENV
- name: Pick tag
id: pick_tag
run: |
SELECTED_TAG=$(./scripts/pick_semver.sh ${{ inputs.graalpy_version }} ${{ inputs.beta }} graalpy)
echo "SELECTED_TAG=$SELECTED_TAG" >> $GITHUB_ENV
echo "::set-output name=release_tag::$SELECTED_TAG"
- name: Create release
run: |
gh release create ${{ env.SELECTED_TAG }} \
--title ${{ env.SELECTED_TAG }} \
--target ${{ github.sha }} \
${{ env.LATEST_TAG && format('--generate-notes --notes-start-tag {0}', env.LATEST_TAG) || format('--notes "GraalPy {0}"', inputs.graalpy_version) }} \
${{ inputs.beta && '--prerelease' || '' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload files
uses: softprops/action-gh-release@v2
with:
files: /tmp/graalpy/graalpy*linux*.zip
tag_name: ${{ env.SELECTED_TAG }}
- name: Upload files
uses: softprops/action-gh-release@v2
with:
files: /tmp/graalpy/graalpy*darwin*.zip
tag_name: ${{ env.SELECTED_TAG }}
- name: Upload files
uses: softprops/action-gh-release@v2
with:
files: /tmp/graalpy/graalpy*windows*.zip
tag_name: ${{ env.SELECTED_TAG }}
outputs:
release_tag: ${{ steps.pick_tag.outputs.release_tag }}
update_installers:
name: Update installers
needs: publish
permissions:
contents: write
uses: ./.github/workflows/update_nodejs_installers.yml
with:
version: ${{ inputs.graalpy_version }}
release_tag: ${{ needs.publish.outputs.release_tag }}
beta: ${{ inputs.beta }}
implementation: graalpy
secrets: inherit