From 5453df7e21b5350ce50168e7d0158ba0f719508d Mon Sep 17 00:00:00 2001 From: niegrzybkowski Date: Fri, 11 Jul 2025 08:53:38 +0200 Subject: [PATCH 1/7] Move install script out of action.yml --- action.yml | 13 ++----------- unix-like.sh | 10 ++++++++++ 2 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 unix-like.sh diff --git a/action.yml b/action.yml index 65a2ff5..1001698 100644 --- a/action.yml +++ b/action.yml @@ -18,17 +18,8 @@ runs: env: GITHUB_TOKEN: ${{ inputs.token }} INPUT_VERSION: ${{ inputs.version }} - run: | - set -e - if [ $INPUT_VERSION = latest ]; then - version=$(gh api repos/Jelly-RDF/cli/releases/latest -q .tag_name); - else - version=$INPUT_VERSION; - if [ ${version:0:1} != 'v' ]; then version="v$version"; fi - fi - wget -O /opt/jelly-cli "https://github.com/Jelly-RDF/cli/releases/download/$version/jelly-cli-linux-x86_64" - chmod +x /opt/jelly-cli - echo '/opt' >> $GITHUB_PATH + run: $GITHUB_ACTION_PATH/unix-like.sh + - name: Setup Jelly CLI (Other) if: runner.os != 'Linux' diff --git a/unix-like.sh b/unix-like.sh new file mode 100644 index 0000000..aa55674 --- /dev/null +++ b/unix-like.sh @@ -0,0 +1,10 @@ +set -e +if [ $INPUT_VERSION = latest ]; then + version=$(gh api repos/Jelly-RDF/cli/releases/latest -q .tag_name); +else + version=$INPUT_VERSION; + if [ ${version:0:1} != 'v' ]; then version="v$version"; fi +fi +wget -O /opt/jelly-cli "https://github.com/Jelly-RDF/cli/releases/download/$version/jelly-cli-linux-x86_64" +chmod +x /opt/jelly-cli +echo '/opt' >> $GITHUB_PATH \ No newline at end of file From 73238202d86a2448241b825bac3c0513fc4496fb Mon Sep 17 00:00:00 2001 From: niegrzybkowski Date: Fri, 11 Jul 2025 09:05:51 +0200 Subject: [PATCH 2/7] Add support for arm and mac --- action.yml | 4 ++-- unix-like.sh | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 1001698..59b78a9 100644 --- a/action.yml +++ b/action.yml @@ -12,8 +12,8 @@ inputs: runs: using: composite steps: - - name: Setup Jelly CLI (Linux x86_64) - if: runner.os == 'Linux' + - name: Setup Jelly CLI (Unix-like) + if: runner.os == 'Linux' || runner.os == 'macOS' shell: bash env: GITHUB_TOKEN: ${{ inputs.token }} diff --git a/unix-like.sh b/unix-like.sh index aa55674..5263431 100644 --- a/unix-like.sh +++ b/unix-like.sh @@ -5,6 +5,12 @@ else version=$INPUT_VERSION; if [ ${version:0:1} != 'v' ]; then version="v$version"; fi fi -wget -O /opt/jelly-cli "https://github.com/Jelly-RDF/cli/releases/download/$version/jelly-cli-linux-x86_64" +if [ $RUNNER_OS = 'Linux' ]; then + osname="linux"; +else + osname="mac"; +fi +arch=$(uname -m) +wget -O /opt/jelly-cli "https://github.com/Jelly-RDF/cli/releases/download/$version/jelly-cli-$osname-$arch" chmod +x /opt/jelly-cli echo '/opt' >> $GITHUB_PATH \ No newline at end of file From 4749d071e26c73f2dce09d2c9fb3e89a56ca13e8 Mon Sep 17 00:00:00 2001 From: niegrzybkowski Date: Fri, 11 Jul 2025 09:19:02 +0200 Subject: [PATCH 3/7] Add support for windows --- action.yml | 14 +++++++------- windows.ps1 | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 windows.ps1 diff --git a/action.yml b/action.yml index 59b78a9..7323c5c 100644 --- a/action.yml +++ b/action.yml @@ -20,10 +20,10 @@ runs: INPUT_VERSION: ${{ inputs.version }} run: $GITHUB_ACTION_PATH/unix-like.sh - - - name: Setup Jelly CLI (Other) - if: runner.os != 'Linux' - shell: bash - run: | - echo "::error::Support for platforms other than Linux x86_64 is not yet implemented" - exit 1 + - name: Setup Jelly CLI (Windows) + if: runner.os == 'Windows' + shell: pwsh + env: + GITHUB_TOKEN: ${{ inputs.token }} + INPUT_VERSION: ${{ inputs.version }} + run: '& $env:GITHUB_ACTION_PATH\windows.ps1' diff --git a/windows.ps1 b/windows.ps1 new file mode 100644 index 0000000..8a6aa5d --- /dev/null +++ b/windows.ps1 @@ -0,0 +1,14 @@ +$ErrorActionPreference = 'Stop' +$ProgressPreference = 'SilentlyContinue' +Set-StrictMode -Version Latest + +if ($env:INPUT_VERSION -eq "latest") { + $version=(gh api repos/Jelly-RDF/cli/releases/latest -q .tag_name) +} elseif ($env:INPUTVERSION.StartsWith("v")) { + $version=$env:INPUTVERSION +} else { + $version="v" + $env:INPUTVERSION +} +New-Item $env:RUNNER_TOOL_CACHE\jelly-cli -ItemType Directory -Force +Invoke-WebRequest https://github.com/Jelly-RDF/cli/releases/download/$version/jelly-cli-windows-x86_64.exe -OutFile $env:RUNNER_TOOL_CACHE\jelly-cli\jelly-cli.exe +Add-Content $env:GITHUB_PATH $env:RUNNER_TOOL_CACHE\jelly-cli \ No newline at end of file From 0e56c1ee9df35b9663ec9ea4294b85e25fe4c993 Mon Sep 17 00:00:00 2001 From: niegrzybkowski Date: Fri, 11 Jul 2025 09:22:32 +0200 Subject: [PATCH 4/7] Add tests for other oses --- .github/workflows/test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b0a177e..4be9cbb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,11 @@ on: jobs: test: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest, ubuntu-24.04-arm] steps: - name: Checkout uses: actions/checkout@v4 From 9542688714a42436d5a1456e0b101a863ac80d67 Mon Sep 17 00:00:00 2001 From: niegrzybkowski Date: Fri, 11 Jul 2025 09:27:55 +0200 Subject: [PATCH 5/7] chmod +x on unix-like.sh --- unix-like.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 unix-like.sh diff --git a/unix-like.sh b/unix-like.sh old mode 100644 new mode 100755 From 5ca4e6ef6e8632c19cd31dfd1d35b5a62fb95146 Mon Sep 17 00:00:00 2001 From: niegrzybkowski Date: Fri, 11 Jul 2025 09:31:38 +0200 Subject: [PATCH 6/7] Move installation to runner tool cache --- unix-like.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/unix-like.sh b/unix-like.sh index 5263431..efa2160 100755 --- a/unix-like.sh +++ b/unix-like.sh @@ -11,6 +11,7 @@ else osname="mac"; fi arch=$(uname -m) -wget -O /opt/jelly-cli "https://github.com/Jelly-RDF/cli/releases/download/$version/jelly-cli-$osname-$arch" -chmod +x /opt/jelly-cli -echo '/opt' >> $GITHUB_PATH \ No newline at end of file +mkdir "$RUNNER_TOOL_CACHE/jelly-cli" +wget -O "$RUNNER_TOOL_CACHE/jelly-cli/jelly-cli" "https://github.com/Jelly-RDF/cli/releases/download/$version/jelly-cli-$osname-$arch" +chmod +x "$RUNNER_TOOL_CACHE/jelly-cli/jelly-cli" +echo "$RUNNER_TOOL_CACHE/jelly-cli" >> $GITHUB_PATH \ No newline at end of file From 7a688b09db9c9bb609e682c9a337509f77361ef0 Mon Sep 17 00:00:00 2001 From: niegrzybkowski Date: Fri, 11 Jul 2025 09:33:37 +0200 Subject: [PATCH 7/7] Translate arm architecture name --- unix-like.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/unix-like.sh b/unix-like.sh index efa2160..ed197c5 100755 --- a/unix-like.sh +++ b/unix-like.sh @@ -11,6 +11,9 @@ else osname="mac"; fi arch=$(uname -m) +if [ $arch = "aarch64" ]; then + arch="arm64" +fi mkdir "$RUNNER_TOOL_CACHE/jelly-cli" wget -O "$RUNNER_TOOL_CACHE/jelly-cli/jelly-cli" "https://github.com/Jelly-RDF/cli/releases/download/$version/jelly-cli-$osname-$arch" chmod +x "$RUNNER_TOOL_CACHE/jelly-cli/jelly-cli"