mirror of
https://github.com/dcarbone/install-jq-action.git
synced 2026-02-12 11:06:55 +08:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e6d52de30 | ||
|
|
8fd607321d | ||
|
|
e397bd8743 | ||
|
|
36b228ee68 | ||
|
|
d5935278d5 | ||
|
|
ca8101273e | ||
|
|
de7c0d1fb1 |
6
.github/dependabot.yml
vendored
Normal file
6
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
2
.github/workflows/example-linux.yaml
vendored
2
.github/workflows/example-linux.yaml
vendored
@@ -19,7 +19,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: 'Setup jq'
|
- name: 'Setup jq'
|
||||||
uses: dcarbone/install-jq-action@v2
|
uses: dcarbone/install-jq-action@v3
|
||||||
with:
|
with:
|
||||||
version: '${{ inputs.version }}'
|
version: '${{ inputs.version }}'
|
||||||
force: '${{ inputs.force }}'
|
force: '${{ inputs.force }}'
|
||||||
|
|||||||
2
.github/workflows/example-macos.yaml
vendored
2
.github/workflows/example-macos.yaml
vendored
@@ -19,7 +19,7 @@ jobs:
|
|||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- name: 'Setup jq'
|
- name: 'Setup jq'
|
||||||
uses: dcarbone/install-jq-action@v2
|
uses: dcarbone/install-jq-action@v3
|
||||||
with:
|
with:
|
||||||
version: '${{ inputs.version }}'
|
version: '${{ inputs.version }}'
|
||||||
force: '${{ inputs.force }}'
|
force: '${{ inputs.force }}'
|
||||||
|
|||||||
2
.github/workflows/example-windows.yaml
vendored
2
.github/workflows/example-windows.yaml
vendored
@@ -19,7 +19,7 @@ jobs:
|
|||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: 'Setup jq'
|
- name: 'Setup jq'
|
||||||
uses: dcarbone/install-jq-action@v2
|
uses: dcarbone/install-jq-action@v3
|
||||||
with:
|
with:
|
||||||
version: '${{ inputs.version }}'
|
version: '${{ inputs.version }}'
|
||||||
force: '${{ inputs.force }}'
|
force: '${{ inputs.force }}'
|
||||||
|
|||||||
111
.github/workflows/tests.yaml
vendored
111
.github/workflows/tests.yaml
vendored
@@ -23,20 +23,115 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
image:
|
image:
|
||||||
- "ubuntu-22.04"
|
- "ubuntu-latest"
|
||||||
- "ubuntu-20.04"
|
- "ubuntu-20.04"
|
||||||
|
- "ubuntu-22.04"
|
||||||
|
- "ubuntu-24.04"
|
||||||
|
- "macos-latest"
|
||||||
- "macos-13"
|
- "macos-13"
|
||||||
- "macos-11"
|
- "macos-14"
|
||||||
- "macos-12"
|
- "macos-15"
|
||||||
- "windows-2022"
|
- "windows-latest"
|
||||||
- "windows-2019"
|
- "windows-2019"
|
||||||
|
- "windows-2022"
|
||||||
force:
|
force:
|
||||||
- 'true'
|
- 'true'
|
||||||
- 'false'
|
- 'false'
|
||||||
version:
|
version:
|
||||||
- '1.5'
|
|
||||||
- '1.6'
|
|
||||||
- '1.7'
|
- '1.7'
|
||||||
|
- '1.7.1'
|
||||||
|
include:
|
||||||
|
- image: "ubuntu-latest"
|
||||||
|
version: '1.6'
|
||||||
|
force: true
|
||||||
|
- image: "ubuntu-latest"
|
||||||
|
version: '1.6'
|
||||||
|
force: false
|
||||||
|
- image: "ubuntu-latest"
|
||||||
|
version: '1.5'
|
||||||
|
force: true
|
||||||
|
- image: "ubuntu-latest"
|
||||||
|
version: '1.5'
|
||||||
|
force: false
|
||||||
|
|
||||||
|
- image: "ubuntu-20.04"
|
||||||
|
version: '1.6'
|
||||||
|
force: true
|
||||||
|
- image: "ubuntu-20.04"
|
||||||
|
version: '1.6'
|
||||||
|
force: false
|
||||||
|
- image: "ubuntu-20.04"
|
||||||
|
version: '1.5'
|
||||||
|
force: true
|
||||||
|
- image: "ubuntu-20.04"
|
||||||
|
version: '1.5'
|
||||||
|
force: false
|
||||||
|
|
||||||
|
- image: "ubuntu-22.04"
|
||||||
|
version: '1.6'
|
||||||
|
force: true
|
||||||
|
- image: "ubuntu-22.04"
|
||||||
|
version: '1.6'
|
||||||
|
force: false
|
||||||
|
- image: "ubuntu-22.04"
|
||||||
|
version: '1.5'
|
||||||
|
force: true
|
||||||
|
- image: "ubuntu-22.04"
|
||||||
|
version: '1.5'
|
||||||
|
force: false
|
||||||
|
|
||||||
|
- image: "ubuntu-24.04"
|
||||||
|
version: '1.6'
|
||||||
|
force: true
|
||||||
|
- image: "ubuntu-24.04"
|
||||||
|
version: '1.6'
|
||||||
|
force: false
|
||||||
|
- image: "ubuntu-24.04"
|
||||||
|
version: '1.5'
|
||||||
|
force: true
|
||||||
|
- image: "ubuntu-24.04"
|
||||||
|
version: '1.5'
|
||||||
|
force: false
|
||||||
|
|
||||||
|
- image: "windows-latest"
|
||||||
|
version: '1.6'
|
||||||
|
force: true
|
||||||
|
- image: "windows-latest"
|
||||||
|
version: '1.6'
|
||||||
|
force: false
|
||||||
|
- image: "windows-latest"
|
||||||
|
version: '1.5'
|
||||||
|
force: true
|
||||||
|
- image: "windows-latest"
|
||||||
|
version: '1.5'
|
||||||
|
force: false
|
||||||
|
|
||||||
|
- image: "windows-2019"
|
||||||
|
version: '1.6'
|
||||||
|
force: true
|
||||||
|
- image: "windows-2019"
|
||||||
|
version: '1.6'
|
||||||
|
force: false
|
||||||
|
- image: "windows-2019"
|
||||||
|
version: '1.5'
|
||||||
|
force: true
|
||||||
|
- image: "windows-2019"
|
||||||
|
version: '1.5'
|
||||||
|
force: false
|
||||||
|
|
||||||
|
- image: "windows-2022"
|
||||||
|
version: '1.6'
|
||||||
|
force: true
|
||||||
|
- image: "windows-2022"
|
||||||
|
version: '1.6'
|
||||||
|
force: false
|
||||||
|
- image: "windows-2022"
|
||||||
|
version: '1.5'
|
||||||
|
force: true
|
||||||
|
- image: "windows-2022"
|
||||||
|
version: '1.5'
|
||||||
|
force: false
|
||||||
|
|
||||||
name: "Test Action - (img: ${{ matrix.image }}; version: ${{ matrix.version }}; force: ${{ matrix.force }})"
|
name: "Test Action - (img: ${{ matrix.image }}; version: ${{ matrix.version }}; force: ${{ matrix.force }})"
|
||||||
runs-on: ${{ matrix.image }}
|
runs-on: ${{ matrix.image }}
|
||||||
steps:
|
steps:
|
||||||
@@ -173,6 +268,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
image:
|
image:
|
||||||
|
- "ubuntu-24.04"
|
||||||
- "ubuntu-22.04"
|
- "ubuntu-22.04"
|
||||||
- "ubuntu-20.04"
|
- "ubuntu-20.04"
|
||||||
force:
|
force:
|
||||||
@@ -182,10 +278,11 @@ jobs:
|
|||||||
- '1.5'
|
- '1.5'
|
||||||
- '1.6'
|
- '1.6'
|
||||||
- '1.7'
|
- '1.7'
|
||||||
|
- '1.7.1'
|
||||||
name: "Test Action (Container) - (img: ${{ matrix.image }}; version: ${{ matrix.version }}; force: ${{ matrix.force }})"
|
name: "Test Action (Container) - (img: ${{ matrix.image }}; version: ${{ matrix.version }}; force: ${{ matrix.force }})"
|
||||||
runs-on: ${{ matrix.image }}
|
runs-on: ${{ matrix.image }}
|
||||||
container:
|
container:
|
||||||
image: node:18.12.1
|
image: node:20
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# install-jq-action
|
# install-jq-action
|
||||||
Multiplatform [jq](https://github.com/stedolan/jq) installer action
|
Multiplatform [jq](https://github.com/stedolan/jq) installer action
|
||||||
|
|
||||||
[](https://github.com/dcarbone/install-jq-action/actions/workflows/tests.yaml)
|
[](https://github.com/dcarbone/install-jq-action/actions/workflows/tests.yaml)
|
||||||
|
|
||||||
This action is tested against the following versions of JQ:
|
This action is tested against the following versions of JQ:
|
||||||
|
|
||||||
|
|||||||
14
action.yaml
14
action.yaml
@@ -9,8 +9,8 @@ branding:
|
|||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
required: false
|
required: false
|
||||||
description: "Version of jq to install"
|
description: "Version of jq to install."
|
||||||
default: "1.7"
|
default: "1.7.1"
|
||||||
force:
|
force:
|
||||||
required: false
|
required: false
|
||||||
description: "If 'true', does not check for existing jq installation before continuing."
|
description: "If 'true', does not check for existing jq installation before continuing."
|
||||||
@@ -30,7 +30,7 @@ runs:
|
|||||||
- name: 'Check for jq - Unix-ish'
|
- name: 'Check for jq - Unix-ish'
|
||||||
id: jq-check-unix
|
id: jq-check-unix
|
||||||
if: (runner.os == 'Linux' || runner.os == 'macOS')
|
if: (runner.os == 'Linux' || runner.os == 'macOS')
|
||||||
shell: bash +e {0}
|
shell: sh +e {0}
|
||||||
# language=sh
|
# language=sh
|
||||||
run: |
|
run: |
|
||||||
_jq_bin="$(which jq)"
|
_jq_bin="$(which jq)"
|
||||||
@@ -41,16 +41,16 @@ runs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
- name: 'Install jq - Unix-ish non-1.7'
|
- name: 'Install jq - Unix-ish non-1.7'
|
||||||
if: (runner.os == 'Linux' || runner.os == 'macOS') && (inputs.version == '1.5' || inputs.version == '1.6') && (steps.jq-check-unix.outputs.found == 'false' || inputs.force == 'true')
|
if: (runner.os == 'Linux' || runner.os == 'macOS') && (startsWith(inputs.version, '1.5') || startsWith(inputs.version, '1.6')) && (steps.jq-check-unix.outputs.found == 'false' || inputs.force == 'true')
|
||||||
shell: bash
|
shell: sh
|
||||||
env:
|
env:
|
||||||
JQ_VERSION: '${{ inputs.version }}'
|
JQ_VERSION: '${{ inputs.version }}'
|
||||||
# language=sh
|
# language=sh
|
||||||
run: ${GITHUB_ACTION_PATH}/scripts/unixish.sh
|
run: ${GITHUB_ACTION_PATH}/scripts/unixish.sh
|
||||||
|
|
||||||
- name: 'Install jq - Unix-ish 1.7'
|
- name: 'Install jq - Unix-ish 1.7'
|
||||||
if: (runner.os == 'Linux' || runner.os == 'macOS') && inputs.version == '1.7' && (steps.jq-check-unix.outputs.found == 'false' || inputs.force == 'true')
|
if: (runner.os == 'Linux' || runner.os == 'macOS') && startsWith(inputs.version, '1.7') && (steps.jq-check-unix.outputs.found == 'false' || inputs.force == 'true')
|
||||||
shell: bash
|
shell: sh
|
||||||
env:
|
env:
|
||||||
JQ_VERSION: '${{ inputs.version }}'
|
JQ_VERSION: '${{ inputs.version }}'
|
||||||
# language=sh
|
# language=sh
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ esac
|
|||||||
|
|
||||||
# determine binary name
|
# determine binary name
|
||||||
|
|
||||||
if [[ "${_os}" == "linux" ]]; then
|
if [ "${_os}" = "linux" ]; then
|
||||||
case "${_arch}" in
|
case "${_arch}" in
|
||||||
'386')
|
'386')
|
||||||
_bin_name="jq-linux32"
|
_bin_name="jq-linux32"
|
||||||
|
|||||||
Reference in New Issue
Block a user