Skip to content

Commit

Permalink
ci: backport failCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorwhitney committed Jul 1, 2024
1 parent 9b7f8fd commit 06e2325
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 52 deletions.
6 changes: 1 addition & 5 deletions .github/release-workflows.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ local lokiRelease = import 'workflows/main.jsonnet';
local build = lokiRelease.build;
local job = lokiRelease.job;

local releaseLibRef = std.filter(
function(dep) dep.source.git.remote == 'https://github.com/grafana/loki-release.git',
(import 'jsonnetfile.json').dependencies
)[0].version;

local releaseLibRef = "release-1.12.x";
local checkTemplate = 'grafana/loki-release/.github/workflows/check.yml@%s' % releaseLibRef;

local imageJobs = {
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"jobs":
"check":
"uses": "grafana/loki-release/.github/workflows/check.yml@loki-2.9.x"
"uses": "grafana/loki-release/.github/workflows/check.yml@release-1.12.x"
"with":
"build_image": "grafana/loki-build-image:0.33.1"
"golang_ci_lint_version": "v1.55.1"
"release_lib_ref": "loki-2.9.x"
"build_image": "grafana/loki-build-image:0.30.1"
"golang_ci_lint_version": "v1.51.2"
"release_lib_ref": "release-1.12.x"
"skip_validation": false
"use_github_app_token": true
"name": "check"
Expand Down
42 changes: 21 additions & 21 deletions .github/workflows/minor-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ env:
CHANGELOG_PATH: "CHANGELOG.md"
DOCKER_USERNAME: "grafana"
IMAGE_PREFIX: "grafana"
RELEASE_LIB_REF: "loki-2.9.x"
RELEASE_LIB_REF: "release-1.12.x"
RELEASE_REPO: "grafana/loki"
SKIP_VALIDATION: false
USE_GITHUB_APP_TOKEN: true
VERSIONING_STRATEGY: "always-bump-minor"
jobs:
check:
uses: "grafana/loki-release/.github/workflows/check.yml@loki-2.9.x"
uses: "grafana/loki-release/.github/workflows/check.yml@release-1.12.x"
with:
build_image: "grafana/loki-build-image:0.33.1"
golang_ci_lint_version: "v1.55.1"
release_lib_ref: "loki-2.9.x"
build_image: "grafana/loki-build-image:0.30.1"
golang_ci_lint_version: "v1.51.2"
release_lib_ref: "release-1.12.x"
skip_validation: false
use_github_app_token: true
create-release-pr:
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
--target-branch "${{ steps.extract_branch.outputs.branch }}" \
--token "${{ steps.github_app_token.outputs.token }}" \
--versioning-strategy "${{ env.VERSIONING_STRATEGY }}"
working-directory: "lib"
dist:
needs:
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
--env SKIP_ARM \
--volume .:/src/loki \
--workdir /src/loki \
--entrypoint /bin/sh "grafana/loki-build-image:0.33.1"
--entrypoint /bin/sh "grafana/loki-build-image:0.30.1"
git config --global --add safe.directory /src/loki
echo "${NFPM_SIGNING_KEY}" > $NFPM_SIGNING_KEY_FILE
make dist packages
Expand Down Expand Up @@ -181,7 +181,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
Expand Down Expand Up @@ -243,7 +243,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
Expand Down Expand Up @@ -305,7 +305,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
Expand Down Expand Up @@ -369,7 +369,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
Expand Down Expand Up @@ -431,7 +431,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
Expand Down Expand Up @@ -495,7 +495,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
Expand Down Expand Up @@ -559,7 +559,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
Expand Down Expand Up @@ -623,7 +623,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
Expand Down Expand Up @@ -687,7 +687,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
Expand Down Expand Up @@ -778,16 +778,16 @@ jobs:
--target-branch "${{ steps.extract_branch.outputs.branch }}" \
--token "${{ steps.github_app_token.outputs.token }}" \
--versioning-strategy "${{ env.VERSIONING_STRATEGY }}"
cat release.json
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)"
Expand Down
42 changes: 21 additions & 21 deletions .github/workflows/patch-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ env:
CHANGELOG_PATH: "CHANGELOG.md"
DOCKER_USERNAME: "grafana"
IMAGE_PREFIX: "grafana"
RELEASE_LIB_REF: "loki-2.9.x"
RELEASE_LIB_REF: "release-1.12.x"
RELEASE_REPO: "grafana/loki"
SKIP_VALIDATION: false
USE_GITHUB_APP_TOKEN: true
VERSIONING_STRATEGY: "always-bump-patch"
jobs:
check:
uses: "grafana/loki-release/.github/workflows/check.yml@loki-2.9.x"
uses: "grafana/loki-release/.github/workflows/check.yml@release-1.12.x"
with:
build_image: "grafana/loki-build-image:0.33.1"
golang_ci_lint_version: "v1.55.1"
release_lib_ref: "loki-2.9.x"
build_image: "grafana/loki-build-image:0.30.1"
golang_ci_lint_version: "v1.51.2"
release_lib_ref: "release-1.12.x"
skip_validation: false
use_github_app_token: true
create-release-pr:
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
--target-branch "${{ steps.extract_branch.outputs.branch }}" \
--token "${{ steps.github_app_token.outputs.token }}" \
--versioning-strategy "${{ env.VERSIONING_STRATEGY }}"
working-directory: "lib"
dist:
needs:
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
--env SKIP_ARM \
--volume .:/src/loki \
--workdir /src/loki \
--entrypoint /bin/sh "grafana/loki-build-image:0.33.1"
--entrypoint /bin/sh "grafana/loki-build-image:0.30.1"
git config --global --add safe.directory /src/loki
echo "${NFPM_SIGNING_KEY}" > $NFPM_SIGNING_KEY_FILE
make dist packages
Expand Down Expand Up @@ -181,7 +181,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
Expand Down Expand Up @@ -243,7 +243,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
Expand Down Expand Up @@ -305,7 +305,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
Expand Down Expand Up @@ -369,7 +369,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
Expand Down Expand Up @@ -431,7 +431,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
Expand Down Expand Up @@ -495,7 +495,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
Expand Down Expand Up @@ -559,7 +559,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
Expand Down Expand Up @@ -623,7 +623,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
Expand Down Expand Up @@ -687,7 +687,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
Expand Down Expand Up @@ -778,16 +778,16 @@ jobs:
--target-branch "${{ steps.extract_branch.outputs.branch }}" \
--token "${{ steps.github_app_token.outputs.token }}" \
--versioning-strategy "${{ env.VERSIONING_STRATEGY }}"
cat release.json
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)"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ concurrency:
env:
IMAGE_PREFIX: "grafana"
PUBLISH_TO_GCS: false
RELEASE_LIB_REF: "loki-2.9.x"
RELEASE_LIB_REF: "release-1.12.x"
RELEASE_REPO: "grafana/loki"
USE_GITHUB_APP_TOKEN: false
jobs:
Expand Down

0 comments on commit 06e2325

Please sign in to comment.