Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 11 additions & 20 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,18 @@ 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 }}
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

- 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
run: $GITHUB_ACTION_PATH/unix-like.sh

- 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'
20 changes: 20 additions & 0 deletions unix-like.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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
if [ $RUNNER_OS = 'Linux' ]; then
osname="linux";
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"
echo "$RUNNER_TOOL_CACHE/jelly-cli" >> $GITHUB_PATH
14 changes: 14 additions & 0 deletions windows.ps1
Original file line number Diff line number Diff line change
@@ -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