From e6a4d5d8ea65ee20e8df896b310fbaf3afd037e9 Mon Sep 17 00:00:00 2001 From: Trevor Whitney Date: Tue, 13 Feb 2024 12:36:01 -0700 Subject: [PATCH] chore: manually install shellcheck --- .github/jsonnetfile.lock.json | 4 +- .github/release-workflows.jsonnet | 3 +- .../.github/workflows/release-pr.yml | 27 ++++ .../loki-release/workflows/validate.libsonnet | 18 +-- .github/workflows/minor-release-pr.yml | 27 ++++ .github/workflows/patch-release-pr.yml | 127 +++++++++++------- 6 files changed, 144 insertions(+), 62 deletions(-) diff --git a/.github/jsonnetfile.lock.json b/.github/jsonnetfile.lock.json index 2b767d4e5786..05e7208f8804 100644 --- a/.github/jsonnetfile.lock.json +++ b/.github/jsonnetfile.lock.json @@ -8,8 +8,8 @@ "subdir": "" } }, - "version": "cdff54a3f3fddb9bb5aa725143f6d95a95af00a4", - "sum": "/AsDqe0lxLj3izpkqm1jGWSuCr3SpsjTg+6fVB72+sU=" + "version": "36ebc075d3f435407ae5de3defb29b467aefabfe", + "sum": "VLe68FGWuHiy2lM51HpF8dgfqdGT72/1AA5zXqJd9YU=" } ], "legacyImports": false diff --git a/.github/release-workflows.jsonnet b/.github/release-workflows.jsonnet index bfc1ca603734..667c5006d90d 100644 --- a/.github/release-workflows.jsonnet +++ b/.github/release-workflows.jsonnet @@ -19,7 +19,8 @@ local build = lokiRelease.build; skipValidation=false, versioningStrategy='always-bump-patch', imagePrefix='grafana', - branches=['release-[0-9].[0-9].x'], + // TODO: remove temp PR branch + branches=['release-[0-9].[0-9].x', 'fix-action-names-in-main'], ), false, false ), 'minor-release-pr.yml': std.manifestYamlDoc( diff --git a/.github/vendor/github.com/grafana/loki-release/.github/workflows/release-pr.yml b/.github/vendor/github.com/grafana/loki-release/.github/workflows/release-pr.yml index dd5087551c85..0d96e13bf9f3 100644 --- a/.github/vendor/github.com/grafana/loki-release/.github/workflows/release-pr.yml +++ b/.github/vendor/github.com/grafana/loki-release/.github/workflows/release-pr.yml @@ -22,6 +22,15 @@ jobs: with: path: "lib" repository: "grafana/loki-release" + - name: "install shellcheck" + uses: "./lib/actions/install-binary" + with: + binary: "shellcheck" + download_url: "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz" + smoke_test: "${binary} --version" + tar_args: "xvf" + tarball_binary_path: "*/${binary}" + version: "0.9.0" - env: BUILD_IN_CONTAINER: false if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" @@ -153,6 +162,15 @@ jobs: with: path: "lib" repository: "grafana/loki-release" + - name: "install shellcheck" + uses: "./lib/actions/install-binary" + with: + binary: "shellcheck" + download_url: "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz" + smoke_test: "${binary} --version" + tar_args: "xvf" + tarball_binary_path: "*/${binary}" + version: "0.9.0" - env: BUILD_IN_CONTAINER: false if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" @@ -280,6 +298,15 @@ jobs: with: path: "lib" repository: "grafana/loki-release" + - name: "install shellcheck" + uses: "./lib/actions/install-binary" + with: + binary: "shellcheck" + download_url: "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz" + smoke_test: "${binary} --version" + tar_args: "xvf" + tarball_binary_path: "*/${binary}" + version: "0.9.0" - env: BUILD_IN_CONTAINER: false if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" diff --git a/.github/vendor/github.com/grafana/loki-release/workflows/validate.libsonnet b/.github/vendor/github.com/grafana/loki-release/workflows/validate.libsonnet index 3ec9485f5348..4358e0007327 100644 --- a/.github/vendor/github.com/grafana/loki-release/workflows/validate.libsonnet +++ b/.github/vendor/github.com/grafana/loki-release/workflows/validate.libsonnet @@ -35,15 +35,15 @@ local setupValidationDeps = function(job) job { // tarball_binary_path: '*/${binary}', // smoke_test: '${binary} version', // }), - // step.new('install shellcheck', './lib/actions/install-binary') - // + step.with({ - // binary: 'shellcheck', - // version: '0.9.0', - // download_url: 'https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz', - // tarball_binary_path: '*/${binary}', - // smoke_test: '${binary} --version', - // tar_args: 'xvf', - // }), + step.new('install shellcheck', './lib/actions/install-binary') + + step.with({ + binary: 'shellcheck', + version: '0.9.0', + download_url: 'https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz', + tarball_binary_path: '*/${binary}', + smoke_test: '${binary} --version', + tar_args: 'xvf', + }), // step.new('install helm', './lib/actions/install-binary') // + step.with({ // binary: 'helm', diff --git a/.github/workflows/minor-release-pr.yml b/.github/workflows/minor-release-pr.yml index e10c20737ccd..4c722a01d561 100644 --- a/.github/workflows/minor-release-pr.yml +++ b/.github/workflows/minor-release-pr.yml @@ -22,6 +22,15 @@ jobs: with: path: "lib" repository: "grafana/loki-release" + - name: "install shellcheck" + uses: "./lib/actions/install-binary" + with: + binary: "shellcheck" + download_url: "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz" + smoke_test: "${binary} --version" + tar_args: "xvf" + tarball_binary_path: "*/${binary}" + version: "0.9.0" - env: BUILD_IN_CONTAINER: false if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" @@ -354,6 +363,15 @@ jobs: with: path: "lib" repository: "grafana/loki-release" + - name: "install shellcheck" + uses: "./lib/actions/install-binary" + with: + binary: "shellcheck" + download_url: "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz" + smoke_test: "${binary} --version" + tar_args: "xvf" + tarball_binary_path: "*/${binary}" + version: "0.9.0" - env: BUILD_IN_CONTAINER: false if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" @@ -1161,6 +1179,15 @@ jobs: with: path: "lib" repository: "grafana/loki-release" + - name: "install shellcheck" + uses: "./lib/actions/install-binary" + with: + binary: "shellcheck" + download_url: "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz" + smoke_test: "${binary} --version" + tar_args: "xvf" + tarball_binary_path: "*/${binary}" + version: "0.9.0" - env: BUILD_IN_CONTAINER: false if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" diff --git a/.github/workflows/patch-release-pr.yml b/.github/workflows/patch-release-pr.yml index 59fc64195516..05aa4b96eba5 100644 --- a/.github/workflows/patch-release-pr.yml +++ b/.github/workflows/patch-release-pr.yml @@ -22,6 +22,15 @@ jobs: with: path: "lib" repository: "grafana/loki-release" + - name: "install shellcheck" + uses: "./lib/actions/install-binary" + with: + binary: "shellcheck" + download_url: "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz" + smoke_test: "${binary} --version" + tar_args: "xvf" + tarball_binary_path: "*/${binary}" + version: "0.9.0" - env: BUILD_IN_CONTAINER: false if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" @@ -180,7 +189,7 @@ jobs: name: "parse image platform" run: | mkdir -p images - + platform="$(echo "${{ matrix.platform}}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")" echo "platform=${platform}" >> $GITHUB_OUTPUT echo "platform_short=$(echo ${{ matrix.platform }} | cut -d / -f 2)" >> $GITHUB_OUTPUT @@ -205,14 +214,14 @@ jobs: --target-branch "${{ steps.extract_branch.outputs.branch }}" \ --token="${{ secrets.GH_TOKEN }}" \ --versioning-strategy "${{ env.VERSIONING_STRATEGY }}" - - if [[ `jq length release.json` -gt 1 ]]; then + + if [[ `jq length release.json` -gt 1 ]]; then echo 'release-please would create more than 1 PR, so cannot determine correct version' echo "pr_created=false" >> $GITHUB_OUTPUT exit 1 fi - - if [[ `jq length release.json` -eq 0 ]]; then + + if [[ `jq length release.json` -eq 0 ]]; then echo "pr_created=false" >> $GITHUB_OUTPUT else version="$(npm run --silent get-version)" @@ -276,7 +285,7 @@ jobs: name: "parse image platform" run: | mkdir -p images - + platform="$(echo "${{ matrix.platform}}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")" echo "platform=${platform}" >> $GITHUB_OUTPUT echo "platform_short=$(echo ${{ matrix.platform }} | cut -d / -f 2)" >> $GITHUB_OUTPUT @@ -301,14 +310,14 @@ jobs: --target-branch "${{ steps.extract_branch.outputs.branch }}" \ --token="${{ secrets.GH_TOKEN }}" \ --versioning-strategy "${{ env.VERSIONING_STRATEGY }}" - - if [[ `jq length release.json` -gt 1 ]]; then + + if [[ `jq length release.json` -gt 1 ]]; then echo 'release-please would create more than 1 PR, so cannot determine correct version' echo "pr_created=false" >> $GITHUB_OUTPUT exit 1 fi - - if [[ `jq length release.json` -eq 0 ]]; then + + if [[ `jq length release.json` -eq 0 ]]; then echo "pr_created=false" >> $GITHUB_OUTPUT else version="$(npm run --silent get-version)" @@ -354,6 +363,15 @@ jobs: with: path: "lib" repository: "grafana/loki-release" + - name: "install shellcheck" + uses: "./lib/actions/install-binary" + with: + binary: "shellcheck" + download_url: "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz" + smoke_test: "${binary} --version" + tar_args: "xvf" + tarball_binary_path: "*/${binary}" + version: "0.9.0" - env: BUILD_IN_CONTAINER: false if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" @@ -401,7 +419,7 @@ jobs: name: "parse image platform" run: | mkdir -p images - + platform="$(echo "${{ matrix.platform}}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")" echo "platform=${platform}" >> $GITHUB_OUTPUT echo "platform_short=$(echo ${{ matrix.platform }} | cut -d / -f 2)" >> $GITHUB_OUTPUT @@ -426,14 +444,14 @@ jobs: --target-branch "${{ steps.extract_branch.outputs.branch }}" \ --token="${{ secrets.GH_TOKEN }}" \ --versioning-strategy "${{ env.VERSIONING_STRATEGY }}" - - if [[ `jq length release.json` -gt 1 ]]; then + + if [[ `jq length release.json` -gt 1 ]]; then echo 'release-please would create more than 1 PR, so cannot determine correct version' echo "pr_created=false" >> $GITHUB_OUTPUT exit 1 fi - - if [[ `jq length release.json` -eq 0 ]]; then + + if [[ `jq length release.json` -eq 0 ]]; then echo "pr_created=false" >> $GITHUB_OUTPUT else version="$(npm run --silent get-version)" @@ -499,7 +517,7 @@ jobs: name: "parse image platform" run: | mkdir -p images - + platform="$(echo "${{ matrix.platform}}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")" echo "platform=${platform}" >> $GITHUB_OUTPUT echo "platform_short=$(echo ${{ matrix.platform }} | cut -d / -f 2)" >> $GITHUB_OUTPUT @@ -524,14 +542,14 @@ jobs: --target-branch "${{ steps.extract_branch.outputs.branch }}" \ --token="${{ secrets.GH_TOKEN }}" \ --versioning-strategy "${{ env.VERSIONING_STRATEGY }}" - - if [[ `jq length release.json` -gt 1 ]]; then + + if [[ `jq length release.json` -gt 1 ]]; then echo 'release-please would create more than 1 PR, so cannot determine correct version' echo "pr_created=false" >> $GITHUB_OUTPUT exit 1 fi - - if [[ `jq length release.json` -eq 0 ]]; then + + if [[ `jq length release.json` -eq 0 ]]; then echo "pr_created=false" >> $GITHUB_OUTPUT else version="$(npm run --silent get-version)" @@ -595,7 +613,7 @@ jobs: name: "parse image platform" run: | mkdir -p images - + platform="$(echo "${{ matrix.platform}}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")" echo "platform=${platform}" >> $GITHUB_OUTPUT echo "platform_short=$(echo ${{ matrix.platform }} | cut -d / -f 2)" >> $GITHUB_OUTPUT @@ -620,14 +638,14 @@ jobs: --target-branch "${{ steps.extract_branch.outputs.branch }}" \ --token="${{ secrets.GH_TOKEN }}" \ --versioning-strategy "${{ env.VERSIONING_STRATEGY }}" - - if [[ `jq length release.json` -gt 1 ]]; then + + if [[ `jq length release.json` -gt 1 ]]; then echo 'release-please would create more than 1 PR, so cannot determine correct version' echo "pr_created=false" >> $GITHUB_OUTPUT exit 1 fi - - if [[ `jq length release.json` -eq 0 ]]; then + + if [[ `jq length release.json` -eq 0 ]]; then echo "pr_created=false" >> $GITHUB_OUTPUT else version="$(npm run --silent get-version)" @@ -693,7 +711,7 @@ jobs: name: "parse image platform" run: | mkdir -p images - + platform="$(echo "${{ matrix.platform}}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")" echo "platform=${platform}" >> $GITHUB_OUTPUT echo "platform_short=$(echo ${{ matrix.platform }} | cut -d / -f 2)" >> $GITHUB_OUTPUT @@ -718,14 +736,14 @@ jobs: --target-branch "${{ steps.extract_branch.outputs.branch }}" \ --token="${{ secrets.GH_TOKEN }}" \ --versioning-strategy "${{ env.VERSIONING_STRATEGY }}" - - if [[ `jq length release.json` -gt 1 ]]; then + + if [[ `jq length release.json` -gt 1 ]]; then echo 'release-please would create more than 1 PR, so cannot determine correct version' echo "pr_created=false" >> $GITHUB_OUTPUT exit 1 fi - - if [[ `jq length release.json` -eq 0 ]]; then + + if [[ `jq length release.json` -eq 0 ]]; then echo "pr_created=false" >> $GITHUB_OUTPUT else version="$(npm run --silent get-version)" @@ -791,7 +809,7 @@ jobs: name: "parse image platform" run: | mkdir -p images - + platform="$(echo "${{ matrix.platform}}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")" echo "platform=${platform}" >> $GITHUB_OUTPUT echo "platform_short=$(echo ${{ matrix.platform }} | cut -d / -f 2)" >> $GITHUB_OUTPUT @@ -816,14 +834,14 @@ jobs: --target-branch "${{ steps.extract_branch.outputs.branch }}" \ --token="${{ secrets.GH_TOKEN }}" \ --versioning-strategy "${{ env.VERSIONING_STRATEGY }}" - - if [[ `jq length release.json` -gt 1 ]]; then + + if [[ `jq length release.json` -gt 1 ]]; then echo 'release-please would create more than 1 PR, so cannot determine correct version' echo "pr_created=false" >> $GITHUB_OUTPUT exit 1 fi - - if [[ `jq length release.json` -eq 0 ]]; then + + if [[ `jq length release.json` -eq 0 ]]; then echo "pr_created=false" >> $GITHUB_OUTPUT else version="$(npm run --silent get-version)" @@ -889,7 +907,7 @@ jobs: name: "parse image platform" run: | mkdir -p images - + platform="$(echo "${{ matrix.platform}}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")" echo "platform=${platform}" >> $GITHUB_OUTPUT echo "platform_short=$(echo ${{ matrix.platform }} | cut -d / -f 2)" >> $GITHUB_OUTPUT @@ -914,14 +932,14 @@ jobs: --target-branch "${{ steps.extract_branch.outputs.branch }}" \ --token="${{ secrets.GH_TOKEN }}" \ --versioning-strategy "${{ env.VERSIONING_STRATEGY }}" - - if [[ `jq length release.json` -gt 1 ]]; then + + if [[ `jq length release.json` -gt 1 ]]; then echo 'release-please would create more than 1 PR, so cannot determine correct version' echo "pr_created=false" >> $GITHUB_OUTPUT exit 1 fi - - if [[ `jq length release.json` -eq 0 ]]; then + + if [[ `jq length release.json` -eq 0 ]]; then echo "pr_created=false" >> $GITHUB_OUTPUT else version="$(npm run --silent get-version)" @@ -985,7 +1003,7 @@ jobs: name: "parse image platform" run: | mkdir -p images - + platform="$(echo "${{ matrix.platform}}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")" echo "platform=${platform}" >> $GITHUB_OUTPUT echo "platform_short=$(echo ${{ matrix.platform }} | cut -d / -f 2)" >> $GITHUB_OUTPUT @@ -1010,14 +1028,14 @@ jobs: --target-branch "${{ steps.extract_branch.outputs.branch }}" \ --token="${{ secrets.GH_TOKEN }}" \ --versioning-strategy "${{ env.VERSIONING_STRATEGY }}" - - if [[ `jq length release.json` -gt 1 ]]; then + + if [[ `jq length release.json` -gt 1 ]]; then echo 'release-please would create more than 1 PR, so cannot determine correct version' echo "pr_created=false" >> $GITHUB_OUTPUT exit 1 fi - - if [[ `jq length release.json` -eq 0 ]]; then + + if [[ `jq length release.json` -eq 0 ]]; then echo "pr_created=false" >> $GITHUB_OUTPUT else version="$(npm run --silent get-version)" @@ -1083,7 +1101,7 @@ jobs: name: "parse image platform" run: | mkdir -p images - + platform="$(echo "${{ matrix.platform}}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")" echo "platform=${platform}" >> $GITHUB_OUTPUT echo "platform_short=$(echo ${{ matrix.platform }} | cut -d / -f 2)" >> $GITHUB_OUTPUT @@ -1108,14 +1126,14 @@ jobs: --target-branch "${{ steps.extract_branch.outputs.branch }}" \ --token="${{ secrets.GH_TOKEN }}" \ --versioning-strategy "${{ env.VERSIONING_STRATEGY }}" - - if [[ `jq length release.json` -gt 1 ]]; then + + if [[ `jq length release.json` -gt 1 ]]; then echo 'release-please would create more than 1 PR, so cannot determine correct version' echo "pr_created=false" >> $GITHUB_OUTPUT exit 1 fi - - if [[ `jq length release.json` -eq 0 ]]; then + + if [[ `jq length release.json` -eq 0 ]]; then echo "pr_created=false" >> $GITHUB_OUTPUT else version="$(npm run --silent get-version)" @@ -1161,6 +1179,15 @@ jobs: with: path: "lib" repository: "grafana/loki-release" + - name: "install shellcheck" + uses: "./lib/actions/install-binary" + with: + binary: "shellcheck" + download_url: "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz" + smoke_test: "${binary} --version" + tar_args: "xvf" + tarball_binary_path: "*/${binary}" + version: "0.9.0" - env: BUILD_IN_CONTAINER: false if: "${{ !fromJSON(env.SKIP_VALIDATION) }}"