ci: prepare 3.0 release workflow (#12344)

Release-As: 3.0.0-alpha.1
pull/12093/head^2
Trevor Whitney 1 year ago committed by GitHub
parent 04398a1562
commit 40f695eecb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      .github/jsonnetfile.lock.json
  2. 4
      .github/release-workflows.jsonnet
  3. 4
      .github/vendor/github.com/grafana/loki-release/workflows/build.libsonnet
  4. 6
      .github/vendor/github.com/grafana/loki-release/workflows/main.jsonnet
  5. 7
      .github/vendor/github.com/grafana/loki-release/workflows/release.libsonnet
  6. 33
      .github/vendor/github.com/grafana/loki-release/workflows/workflows.jsonnet
  7. 28
      .github/workflows/minor-release-pr.yml
  8. 27
      .github/workflows/patch-release-pr.yml
  9. 4
      .github/workflows/release.yml

@ -8,8 +8,8 @@
"subdir": "workflows"
}
},
"version": "d9bfe17ed706fdfbd02445a576eb820dea4811a3",
"sum": "RCFmsb2FD3ZQmjSVfAo+5/GNi2mit/T9BZ474iE2u2o="
"version": "d3fa90c124d13a4e0359a46c8708704e92ee8a50",
"sum": "TQ2X5sm7o+BCrytzSbJ7Th2YqNZ2ZPx9Wg62x5mEVJ0="
}
],
"legacyImports": false

@ -46,7 +46,7 @@ local imagePrefix = 'grafana';
),
'minor-release-pr.yml': std.manifestYamlDoc(
lokiRelease.releasePRWorkflow(
branches=['k[0-9]+'],
branches=['k[0-9]+', 'main'],
buildImage=buildImage,
checkTemplate=checkTemplate,
golangCiLintVersion=golangCiLintVersion,
@ -63,7 +63,7 @@ local imagePrefix = 'grafana';
),
'release.yml': std.manifestYamlDoc(
lokiRelease.releaseWorkflow(
branches=['release-[0-9]+.[0-9]+.x', 'k[0-9]+'],
branches=['release-[0-9]+.[0-9]+.x', 'k[0-9]+', 'main'],
getDockerCredsFromVault=true,
imagePrefix='grafana',
releaseLibRef=releaseLibRef,

@ -60,7 +60,7 @@ local releaseLibStep = common.releaseLibStep;
+ step.withIf('${{ fromJSON(needs.version.outputs.pr_created) }}')
+ step.with({
path: 'release/images/%s-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar' % name,
destination: 'loki-build-artifacts/${{ github.sha }}/images', //TODO: make bucket configurable
destination: '${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images', //TODO: make bucket configurable
process_gcloudignore: false,
}),
]),
@ -211,7 +211,7 @@ local releaseLibStep = common.releaseLibStep;
+ step.withIf('${{ fromJSON(needs.version.outputs.pr_created) }}')
+ step.with({
path: 'release/dist',
destination: 'loki-build-artifacts/${{ github.sha }}', //TODO: make bucket configurable
destination: '${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}', //TODO: make bucket configurable
process_gcloudignore: false,
}),
]),

@ -8,10 +8,12 @@
validateGel: import 'validate-gel.libsonnet',
releasePRWorkflow: function(
branches=['release-[0-9]+.[0-9]+.x', 'k[0-9]+'],
buildArtifactsBucket='loki-build-artifacts',
buildImage='grafana/loki-build-image:0.33.0',
changelogPath='CHANGELOG.md',
checkTemplate='./.github/workflows/check.yml',
distMakeTargets=['dist', 'packages'],
dryRun=false,
dockerUsername='grafana',
golangCiLintVersion='v1.55.1',
imageBuildTimeoutMin=25,
@ -40,9 +42,11 @@
group: 'create-release-pr-${{ github.sha }}',
},
env: {
BUILD_ARTIFACTS_BUCKET: buildArtifactsBucket,
BUILD_TIMEOUT: imageBuildTimeoutMin,
CHANGELOG_PATH: changelogPath,
DOCKER_USERNAME: dockerUsername,
DRY_RUN: dryRun,
IMAGE_PREFIX: imagePrefix,
RELEASE_LIB_REF: releaseLibRef,
RELEASE_REPO: releaseRepo,
@ -72,6 +76,7 @@
},
releaseWorkflow: function(
branches=['release-[0-9].[0-9].x', 'k[0-9]*'],
buildArtifactsBucket='loki-build-artifacts',
dockerUsername='grafanabot',
getDockerCredsFromVault=false,
imagePrefix='grafana',
@ -96,6 +101,7 @@
group: 'create-release-${{ github.sha }}',
},
env: {
BUILD_ARTIFACTS_BUCKET: buildArtifactsBucket,
IMAGE_PREFIX: imagePrefix,
RELEASE_LIB_REF: releaseLibRef,
RELEASE_REPO: releaseRepo,

@ -9,7 +9,7 @@ local releaseLibStep = common.releaseLibStep;
// sha to release and pull aritfacts from. If you need to change this, make sure
// to change it in both places.
//TODO: make bucket configurable
local pullRequestFooter = 'Merging this PR will release the [artifacts](https://console.cloud.google.com/storage/browser/loki-build-artifacts/${SHA}) of ${SHA}';
local pullRequestFooter = 'Merging this PR will release the [artifacts](https://console.cloud.google.com/storage/browser/${BUILD_ARTIFACTS_BUCKET}/${SHA}) of ${SHA}';
{
createReleasePR:
@ -45,7 +45,8 @@ local pullRequestFooter = 'Merging this PR will release the [artifacts](https://
--separate-pull-requests false \
--target-branch "${{ steps.extract_branch.outputs.branch }}" \
--token "${{ steps.github_app_token.outputs.token }}" \
--versioning-strategy "${{ env.VERSIONING_STRATEGY }}"
--versioning-strategy "${{ env.VERSIONING_STRATEGY }}" \
--dry-run ${{ fromJSON(env.DRY_RUN) }}
||| % pullRequestFooter),
]),
@ -89,7 +90,7 @@ local pullRequestFooter = 'Merging this PR will release the [artifacts](https://
releaseStep('download binaries')
+ step.withRun(|||
echo "downloading binaries to $(pwd)/dist"
gsutil cp -r gs://loki-build-artifacts/${{ needs.shouldRelease.outputs.sha }}/dist .
gsutil cp -r gs://${BUILD_ARTIFACTS_BUCKET}/${{ needs.shouldRelease.outputs.sha }}/dist .
|||),
releaseStep('check if release exists')

@ -6,23 +6,52 @@ local build = lokiRelease.build;
imageJobs={
loki: build.image('fake-loki', 'cmd/loki'),
},
buildArtifactsBucket='loki-build-artifacts',
branches=['release-[0-9]+.[0-9]+.x'],
imagePrefix='trevorwhitney075',
releaseLibRef='release-1.12.x',
releaseRepo='grafana/loki-release',
skipValidation=false,
versioningStrategy='always-bump-patch',
), false, false
) + {
name: 'Create Release PR',
}, false, false
),
'.github/workflows/test-release-pr.yml': std.manifestYamlDoc(
lokiRelease.releasePRWorkflow(
imageJobs={
loki: build.image('fake-loki', 'cmd/loki'),
},
buildArtifactsBucket='loki-build-artifacts',
branches=['release-[0-9]+.[0-9]+.x'],
dryRun=true,
imagePrefix='trevorwhitney075',
releaseLibRef='release-1.12.x',
releaseRepo='grafana/loki-release',
skipValidation=false,
versioningStrategy='always-bump-patch',
) + {
name: 'Test Create Release PR Action',
on+: {
pull_request: {},
},
}, false, false
),
'.github/workflows/release.yml': std.manifestYamlDoc(
lokiRelease.releaseWorkflow(
branches=['release-[0-9]+.[0-9]+.x'],
buildArtifactsBucket='loki-build-artifacts',
getDockerCredsFromVault=true,
imagePrefix='trevorwhitney075',
releaseLibRef='release-1.12.x',
releaseRepo='grafana/loki-release',
useGitHubAppToken=false,
), false, false
) + {
name: 'Create Release',
on+: {
pull_request: {},
},
}, false, false
),
'.github/workflows/check.yml': std.manifestYamlDoc(
lokiRelease.check

@ -1,9 +1,11 @@
concurrency:
group: "create-release-pr-${{ github.sha }}"
env:
BUILD_ARTIFACTS_BUCKET: "loki-build-artifacts"
BUILD_TIMEOUT: 40
CHANGELOG_PATH: "CHANGELOG.md"
DOCKER_USERNAME: "grafana"
DRY_RUN: false
IMAGE_PREFIX: "grafana"
RELEASE_LIB_REF: "main"
RELEASE_REPO: "grafana/loki"
@ -81,14 +83,15 @@ jobs:
--group-pull-request-title-pattern "chore\${scope}: release\${component} \${version}" \
--label "backport main,autorelease: pending,product-approved" \
--manifest-file .release-please-manifest.json \
--pull-request-footer "Merging this PR will release the [artifacts](https://console.cloud.google.com/storage/browser/loki-build-artifacts/${SHA}) of ${SHA}" \
--pull-request-footer "Merging this PR will release the [artifacts](https://console.cloud.google.com/storage/browser/${BUILD_ARTIFACTS_BUCKET}/${SHA}) of ${SHA}" \
--pull-request-title-pattern "chore\${scope}: release\${component} \${version}" \
--release-type simple \
--repo-url "${{ env.RELEASE_REPO }}" \
--separate-pull-requests false \
--target-branch "${{ steps.extract_branch.outputs.branch }}" \
--token "${{ steps.github_app_token.outputs.token }}" \
--versioning-strategy "${{ env.VERSIONING_STRATEGY }}"
--versioning-strategy "${{ env.VERSIONING_STRATEGY }}" \
--dry-run ${{ fromJSON(env.DRY_RUN) }}
working-directory: "lib"
dist:
@ -146,7 +149,7 @@ jobs:
name: "upload artifacts"
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "loki-build-artifacts/${{ github.sha }}"
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}"
path: "release/dist"
process_gcloudignore: false
fluent-bit:
@ -203,7 +206,7 @@ jobs:
name: "upload artifacts"
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "loki-build-artifacts/${{ github.sha }}/images"
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
path: "release/images/fluent-bit-plugin-loki-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
process_gcloudignore: false
strategy:
@ -265,7 +268,7 @@ jobs:
name: "upload artifacts"
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "loki-build-artifacts/${{ github.sha }}/images"
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
path: "release/images/fluent-plugin-loki-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
process_gcloudignore: false
strategy:
@ -327,7 +330,7 @@ jobs:
name: "upload artifacts"
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "loki-build-artifacts/${{ github.sha }}/images"
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
path: "release/images/logcli-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
process_gcloudignore: false
strategy:
@ -391,7 +394,7 @@ jobs:
name: "upload artifacts"
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "loki-build-artifacts/${{ github.sha }}/images"
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
path: "release/images/logstash-output-loki-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
process_gcloudignore: false
strategy:
@ -453,7 +456,7 @@ jobs:
name: "upload artifacts"
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "loki-build-artifacts/${{ github.sha }}/images"
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
path: "release/images/loki-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
process_gcloudignore: false
strategy:
@ -517,7 +520,7 @@ jobs:
name: "upload artifacts"
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "loki-build-artifacts/${{ github.sha }}/images"
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
path: "release/images/loki-canary-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
process_gcloudignore: false
strategy:
@ -581,7 +584,7 @@ jobs:
name: "upload artifacts"
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "loki-build-artifacts/${{ github.sha }}/images"
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
path: "release/images/loki-canary-boringcrypto-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
process_gcloudignore: false
strategy:
@ -645,7 +648,7 @@ jobs:
name: "upload artifacts"
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "loki-build-artifacts/${{ github.sha }}/images"
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
path: "release/images/promtail-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
process_gcloudignore: false
strategy:
@ -709,7 +712,7 @@ jobs:
name: "upload artifacts"
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "loki-build-artifacts/${{ github.sha }}/images"
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
path: "release/images/loki-query-tee-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
process_gcloudignore: false
strategy:
@ -801,6 +804,7 @@ name: "create release PR"
push:
branches:
- "k[0-9]+"
- "main"
permissions:
contents: "write"
id-token: "write"

@ -1,9 +1,11 @@
concurrency:
group: "create-release-pr-${{ github.sha }}"
env:
BUILD_ARTIFACTS_BUCKET: "loki-build-artifacts"
BUILD_TIMEOUT: 40
CHANGELOG_PATH: "CHANGELOG.md"
DOCKER_USERNAME: "grafana"
DRY_RUN: false
IMAGE_PREFIX: "grafana"
RELEASE_LIB_REF: "main"
RELEASE_REPO: "grafana/loki"
@ -81,14 +83,15 @@ jobs:
--group-pull-request-title-pattern "chore\${scope}: release\${component} \${version}" \
--label "backport main,autorelease: pending,product-approved" \
--manifest-file .release-please-manifest.json \
--pull-request-footer "Merging this PR will release the [artifacts](https://console.cloud.google.com/storage/browser/loki-build-artifacts/${SHA}) of ${SHA}" \
--pull-request-footer "Merging this PR will release the [artifacts](https://console.cloud.google.com/storage/browser/${BUILD_ARTIFACTS_BUCKET}/${SHA}) of ${SHA}" \
--pull-request-title-pattern "chore\${scope}: release\${component} \${version}" \
--release-type simple \
--repo-url "${{ env.RELEASE_REPO }}" \
--separate-pull-requests false \
--target-branch "${{ steps.extract_branch.outputs.branch }}" \
--token "${{ steps.github_app_token.outputs.token }}" \
--versioning-strategy "${{ env.VERSIONING_STRATEGY }}"
--versioning-strategy "${{ env.VERSIONING_STRATEGY }}" \
--dry-run ${{ fromJSON(env.DRY_RUN) }}
working-directory: "lib"
dist:
@ -146,7 +149,7 @@ jobs:
name: "upload artifacts"
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "loki-build-artifacts/${{ github.sha }}"
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}"
path: "release/dist"
process_gcloudignore: false
fluent-bit:
@ -203,7 +206,7 @@ jobs:
name: "upload artifacts"
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "loki-build-artifacts/${{ github.sha }}/images"
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
path: "release/images/fluent-bit-plugin-loki-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
process_gcloudignore: false
strategy:
@ -265,7 +268,7 @@ jobs:
name: "upload artifacts"
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "loki-build-artifacts/${{ github.sha }}/images"
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
path: "release/images/fluent-plugin-loki-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
process_gcloudignore: false
strategy:
@ -327,7 +330,7 @@ jobs:
name: "upload artifacts"
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "loki-build-artifacts/${{ github.sha }}/images"
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
path: "release/images/logcli-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
process_gcloudignore: false
strategy:
@ -391,7 +394,7 @@ jobs:
name: "upload artifacts"
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "loki-build-artifacts/${{ github.sha }}/images"
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
path: "release/images/logstash-output-loki-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
process_gcloudignore: false
strategy:
@ -453,7 +456,7 @@ jobs:
name: "upload artifacts"
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "loki-build-artifacts/${{ github.sha }}/images"
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
path: "release/images/loki-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
process_gcloudignore: false
strategy:
@ -517,7 +520,7 @@ jobs:
name: "upload artifacts"
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "loki-build-artifacts/${{ github.sha }}/images"
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
path: "release/images/loki-canary-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
process_gcloudignore: false
strategy:
@ -581,7 +584,7 @@ jobs:
name: "upload artifacts"
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "loki-build-artifacts/${{ github.sha }}/images"
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
path: "release/images/loki-canary-boringcrypto-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
process_gcloudignore: false
strategy:
@ -645,7 +648,7 @@ jobs:
name: "upload artifacts"
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "loki-build-artifacts/${{ github.sha }}/images"
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
path: "release/images/promtail-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
process_gcloudignore: false
strategy:
@ -709,7 +712,7 @@ jobs:
name: "upload artifacts"
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "loki-build-artifacts/${{ github.sha }}/images"
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
path: "release/images/loki-query-tee-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
process_gcloudignore: false
strategy:

@ -1,6 +1,7 @@
concurrency:
group: "create-release-${{ github.sha }}"
env:
BUILD_ARTIFACTS_BUCKET: "loki-build-artifacts"
IMAGE_PREFIX: "grafana"
PUBLISH_TO_GCS: false
RELEASE_LIB_REF: "main"
@ -61,7 +62,7 @@ jobs:
- name: "download binaries"
run: |
echo "downloading binaries to $(pwd)/dist"
gsutil cp -r gs://loki-build-artifacts/${{ needs.shouldRelease.outputs.sha }}/dist .
gsutil cp -r gs://${BUILD_ARTIFACTS_BUCKET}/${{ needs.shouldRelease.outputs.sha }}/dist .
working-directory: "release"
- env:
GH_TOKEN: "${{ steps.github_app_token.outputs.token }}"
@ -214,6 +215,7 @@ name: "create release"
branches:
- "release-[0-9]+.[0-9]+.x"
- "k[0-9]+"
- "main"
permissions:
contents: "write"
id-token: "write"

Loading…
Cancel
Save