Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
louisjoecodes committed Jan 22, 2024
1 parent 5dbd239 commit 3432df7
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CI for Quary CLI Action

on: [push, pull_request]

jobs:
test-action:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Test Install Latest Version
uses: ./
with:
version: 'latest'

- name: Test Install Specific Version
uses: ./
with:
version: '0.0.67'
26 changes: 26 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 'Install Quary CLI'
description: 'Installs the Quary CLI on Ubuntu'
inputs:
version:
description: 'Version of Quary CLI to install'
required: false
default: 'latest'
runs:
using: 'composite'
steps:
- run: |
if [ "${{ inputs.version }}" = "latest" ]; then
# Fetch the latest release tag from GitHub API without authentication
LATEST_VERSION=$(curl -s https://api.github.com/repos/quarylabs/quary-cli/releases/latest | grep 'tag_name' | cut -d '"' -f 4)
echo "Latest version is $LATEST_VERSION"
VERSION=$LATEST_VERSION
else
VERSION=${{ inputs.version }}
fi
echo "Installing Quary CLI version $VERSION"
wget https://github.com/quarylabs/quary-cli/releases/download/$VERSION/quary-$VERSION-quary-linux-x86_64-gnu.zip -O quary-cli.zip
unzip quary-cli.zip -d quary-cli
sudo mv "quary-cli/quary-$VERSION" /usr/local/bin/quary
quary --version
shell: bash

0 comments on commit 3432df7

Please sign in to comment.