├── .github └── workflows │ ├── release.yaml │ ├── semver.yml │ └── test.yml ├── Dockerfile ├── LICENSE ├── README.md ├── action.yml └── entrypoint.sh /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | name: Release 2 | on: 3 | push: 4 | tags: 5 | - 'v*.*.*' 6 | 7 | jobs: 8 | release: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Create Release 12 | id: create_release 13 | uses: actions/create-release@v1.0.0 14 | env: 15 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 16 | with: 17 | tag_name: ${{ github.ref }} 18 | release_name: Release ${{ github.ref }} 19 | draft: false 20 | prerelease: false 21 | -------------------------------------------------------------------------------- /.github/workflows/semver.yml: -------------------------------------------------------------------------------- 1 | name: Run gitwerk 2 | on: 3 | push: 4 | branches: 5 | - master 6 | 7 | jobs: 8 | semver-auto: 9 | name: Run semver-auto 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Check out code. 13 | uses: actions/checkout@v1 14 | with: 15 | fetch-depth: 0 16 | - name: Get latest gitwerk 17 | run: | 18 | wget "https://github.com/rinx/gitwerk/releases/latest/download/gitwerk-linux-amd64.zip" 19 | unzip gitwerk-linux-amd64.zip 20 | - name: Run gitwerk semver-auto 21 | run: | 22 | ./gitwerk contextual-semver 23 | git remote set-url origin "https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" 24 | git push origin --tags 25 | env: 26 | GITHUB_USER: ${{ secrets.SETUP_GRAALVM_CE_USER }} 27 | GITHUB_TOKEN: ${{ secrets.SETUP_GRAALVM_CE_TOKEN }} 28 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | on: push 3 | 4 | jobs: 5 | test: 6 | runs-on: ubuntu-latest 7 | steps: 8 | - name: setup-graalvm-ce 9 | uses: rinx/setup-graalvm-ce@master 10 | with: 11 | graalvm-version: "20.2.0" 12 | java-version: "java11" 13 | native-image: "true" 14 | - name: native-image version 15 | run: | 16 | native-image --version 17 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:devel 2 | 3 | RUN apt-get update \ 4 | && apt-get install -y \ 5 | curl \ 6 | && rm -rf /var/lib/apt/lists/* 7 | 8 | COPY entrypoint.sh /entrypoint.sh 9 | 10 | ENTRYPOINT ["/entrypoint.sh"] 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2019 GitHub, Inc. and contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # setup-graalvm-ce 2 | 3 | This is a GitHub Action for setting up GraalVM CE of specified version. 4 | 5 | ## Inputs 6 | 7 | ### `graalvm-version` 8 | 9 | GraalVM version (required) 10 | 11 | Default: 20.2.0 12 | 13 | ### `java-version` 14 | 15 | Java version (required) 16 | 17 | Default: java8 18 | 19 | ### `native-image` 20 | 21 | Install native-image 22 | 23 | Default: true 24 | 25 | ## Examples 26 | 27 | ```yaml 28 | on: push 29 | jobs: 30 | setup-graalvm-ce: 31 | runs-on: ubuntu-latest 32 | steps: 33 | - name: setup-graalvm-ce 34 | uses: rinx/setup-graalvm-ce@v0.0.5 35 | with: 36 | graalvm-version: "20.2.0" 37 | java-version: "java11" 38 | native-image: "true" 39 | - name: version 40 | run: | 41 | java -version 42 | native-image --version 43 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: 'Setup GraalVM CE' 2 | description: 'GitHub Action for setting up GraalVM CE of specified version' 3 | author: 'rinx ' 4 | branding: 5 | icon: 'box' 6 | color: 'blue' 7 | inputs: 8 | graalvm-version: 9 | description: 'GraalVM version: ex.) 19.3.0, 20.1.0' 10 | required: true 11 | default: '20.2.0' 12 | java-version: 13 | description: 'Java version: ex.) java8, java11' 14 | required: true 15 | default: 'java8' 16 | native-image: 17 | description: 'enable native-image command' 18 | required: true 19 | default: 'true' 20 | runs: 21 | using: 'docker' 22 | image: 'Dockerfile' 23 | args: 24 | - ${{ inputs.graalvm-version }} 25 | - ${{ inputs.java-version }} 26 | - ${{ inputs.native-image }} 27 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | GRAALVM_VERSION=$1 5 | JAVA_VERSION=$2 6 | NATIVE_IMAGE_ENABLED=$3 7 | TMP_GRAALVM_HOME=/github/home/graalvm 8 | GRAALVM_HOME=/home/runner/work/_temp/_github_home/graalvm 9 | 10 | echo "Install GRAALVM $GRAALVM_VERSION $JAVA_VERSION" 11 | 12 | GRAALVM_TGZ_URI="https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-${GRAALVM_VERSION}/graalvm-ce-${JAVA_VERSION}-linux-amd64-${GRAALVM_VERSION}.tar.gz" 13 | 14 | curl -sL $GRAALVM_TGZ_URI --output graalvm.tar.gz 15 | 16 | mkdir -p $TMP_GRAALVM_HOME 17 | tar -xf graalvm.tar.gz -C $TMP_GRAALVM_HOME --strip-components=1 18 | chmod -R a+rwx $TMP_GRAALVM_HOME 19 | 20 | if [ "$NATIVE_IMAGE_ENABLED" = "true" ]; then 21 | echo "Install native-image" 22 | $TMP_GRAALVM_HOME/bin/gu install native-image 23 | fi 24 | 25 | echo "${GRAALVM_HOME}/bin" >> $GITHUB_PATH 26 | echo "GRAALVM_HOME=${GRAALVM_HOME}" >> $GITHUB_ENV 27 | echo "JAVA_HOME=${GRAALVM_HOME}" >> $GITHUB_ENV 28 | echo "GRAALVM_VERSION=${GRAALVM_VERSION}" >> $GITHUB_ENV 29 | --------------------------------------------------------------------------------