Skip to content

Commit

Permalink
[main] Use install-yq and update yq version (rancher#48876)
Browse files Browse the repository at this point in the history
Forward-port of rancher#48869

Co-authored-by: Pedro Tashima <[email protected]>
  • Loading branch information
pmatseykanets and tashima42 authored Jan 24, 2025
1 parent 4a35eb0 commit e2cebb4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
9 changes: 7 additions & 2 deletions .github/actions/install-yq/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@ description: "Install yq from source"
inputs:
version:
description: "yq version"
default: v4.44.3
default: v4.45.1
arch:
description: "host arch"
required: true
use-sudo:
description: "use sudo to move the yq binary"
default: false
runs:
using: "composite"
steps:
- name: install yq
shell: bash
run: curl -fsL https://github.com/mikefarah/yq/releases/download/${{ inputs.version }}/yq_linux_${{ inputs.arch }}.tar.gz | tar xz && mv yq_linux_${{ inputs.arch }} /usr/bin/yq
run: |
curl -fsL https://github.com/mikefarah/yq/releases/download/${{ inputs.version }}/yq_linux_${{ inputs.arch }}.tar.gz | tar xz
${{ inputs.use-sudo == 'true' && 'sudo' || '' }} mv yq_linux_${{ inputs.arch }} /usr/bin/yq
16 changes: 10 additions & 6 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: install yq
shell: bash
run: sudo snap install yq
- id: env
uses: ./.github/actions/install-yq
with:
arch: ${{ env.ARCH }}
use-sudo: true
- id: env
name: Setup Dependencies Env Variables
uses: ./.github/actions/setup-build-env
- name: Docker meta
Expand Down Expand Up @@ -147,9 +149,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: install yq
shell: bash
run: sudo snap install yq
- id: env
uses: ./.github/actions/install-yq
with:
arch: ${{ env.ARCH }}
use-sudo: true
- id: env
name: Setup Dependencies Env Variables
uses: ./.github/actions/setup-build-env
- name: Docker meta
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/push-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: install yq
shell: bash
run: sudo snap install yq
uses: ./.github/actions/install-yq
with:
arch: ${{ env.ARCH }}
use-sudo: true
- name: Setup Environment Variables
uses: ./.github/actions/setup-tag-env
- id: env
Expand Down Expand Up @@ -190,8 +192,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: install yq
shell: bash
run: sudo snap install yq
uses: ./.github/actions/install-yq
with:
arch: ${{ env.ARCH }}
use-sudo: true
- id: env
name: Setup Dependencies Env Variables
uses: ./.github/actions/setup-build-env
Expand Down

0 comments on commit e2cebb4

Please sign in to comment.