diff --git a/.github/workflows/logql-analyzer.yml b/.github/workflows/logql-analyzer.yml index f0e3df978251..d78d90fb805a 100644 --- a/.github/workflows/logql-analyzer.yml +++ b/.github/workflows/logql-analyzer.yml @@ -22,25 +22,28 @@ jobs: - uses: actions/checkout@v4 with: fetch-tags: true + path: loki - - name: Run shell command + - name: prepare id: prepare env: MAJOR_MINOR_VERSION_REGEXP: '([0-9]+\\.[0-9]+)' RELEASE_TAG_REGEXP: '^([0-9]+\\.[0-9]+\\.[0-9]+)$' + working-directory: loki run: | - echo $("${WORKSPACE_ROOT}/loki/tools/image-tag") > .tag - if [[ "${RELEASE_VERSION}" == "test" ]]; then + echo "$(./tools/image-tag)" > .tag + if [[ "$RELEASE_VERSION" == "test" ]]; then echo "RELEASE_VERSION is not set, using image tag" - RELEASE_VERSION=$(cat .tag) + RELEASE_VERSION="$(cat .tag)" fi + echo "RELEASE_VERSION: $RELEASE_VERSION" # if the tag matches the pattern `D.D.D` then RELEASE_NAME="D-D-x", otherwise RELEASE_NAME="next" RELEASE_NAME=$([[ $RELEASE_VERSION =~ $RELEASE_TAG_REGEXP ]] && echo $RELEASE_TAG | grep -oE $MAJOR_MINOR_VERSION_REGEXP | sed "s/\\./-/g" | sed "s/$/-x/" || echo "next") echo "RELEASE_NAME: $RELEASE_NAME" - echo "::set-output name=release_version::${RELEASE_VERSION}" - echo "::set-output name=release_name::${RELEASE_NAME}" + echo "release_version=${RELEASE_VERSION}" >> "$GITHUB_OUTPUT" + echo "release_name=${RELEASE_NAME}" >> "$GITHUB_OUTPUT" - id: "get-github-app-token" name: "get github app token" @@ -62,7 +65,8 @@ jobs: uses: "docker/build-push-action@v6" with: build-args: "IMAGE_TAG=${{ steps.prepare.outputs.release_version }}" - file: "cmd/logql-analyzer/Dockerfile" + context: loki + file: "loki/cmd/logql-analyzer/Dockerfile" platforms: "linux/amd64" push: true tags: "grafana/logql-analyzer:${{ steps.prepare.outputs.release_version }}" @@ -70,6 +74,7 @@ jobs: - name: Log in to Google Artifact Registry uses: grafana/shared-workflows/actions/login-to-gar@main with: + registry: "us-docker.pkg.dev" environment: "prod" - name: Update to latest image diff --git a/.github/workflows/scripts/helm-tagged-release.sh b/.github/workflows/scripts/helm-tagged-release.sh index fd6c06f520d0..4a0d90eec59a 100755 --- a/.github/workflows/scripts/helm-tagged-release.sh +++ b/.github/workflows/scripts/helm-tagged-release.sh @@ -51,4 +51,5 @@ sed --in-place \ make TTY='' helm-docs -echo "::set-output name=new_chart_version::${new_chart_version}" +# shellcheck disable=SC2154,SC2250 +echo "new_chart_version=${new_chart_version}" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/scripts/helm-weekly-release.sh b/.github/workflows/scripts/helm-weekly-release.sh index f836b2c694b6..6b3d6043b604 100755 --- a/.github/workflows/scripts/helm-weekly-release.sh +++ b/.github/workflows/scripts/helm-weekly-release.sh @@ -106,7 +106,9 @@ fi make TTY='' helm-docs -echo "::set-output name=new_chart_version::${new_chart_version}" +# shellcheck disable=SC2154,SC2250 +echo "new_chart_version=${new_chart_version}" >> "$GITHUB_OUTPUT" if ${k_release}; then - echo "::set-output name=weekly::$(extract_k_version "${latest_loki_tag}")" + # shellcheck disable=SC2154,SC2250 + echo "weekly=$(extract_k_version "${latest_loki_tag}")" >> "$GITHUB_OUTPUT" fi