Like Prometheus, but for logs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
loki/.github/workflows/operator-release-please.yml

101 lines
3.5 KiB

name: operator-release-please
on:
push:
paths:
- 'operator/**'
branches:
- main
permissions:
contents: read
pull-requests: read
jobs:
releasePlease:
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
pull-requests: "write"
outputs:
release_created: ${{ steps.release.outputs.operator--release_created }}
release_name: ${{ steps.release.outputs.operator--tag_name }}
release_major: ${{ steps.release.outputs.operator--major }}
release_minor: ${{ steps.release.outputs.operator--minor }}
release_patch: ${{ steps.release.outputs.operator--patch }}
steps:
- name: Retrieve GitHub App Credentials from Vault
id: get-secrets
uses: grafana/shared-workflows/actions/get-vault-secrets@28361cdb22223e5f1e34358c86c20908e7248760
with:
repo_secrets: |
APP_ID=loki-gh-app:app-id
PRIVATE_KEY=loki-gh-app:private-key
- name: Generate GitHub App Token
id: app-token
uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1
with:
# Variables generated by the previous step get-secrets
app-id: ${{ env.APP_ID }}
private-key: ${{ env.PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- uses: googleapis/release-please-action@c2a5a2bd6a758a0937f1ddb1e8950609867ed15c # v4.3.0
id: release
with:
path: operator
config-file: operator/release-please-config.json
token: ${{ steps.app-token.outputs.token }}
publishImages:
needs:
- "releasePlease"
if: ${{ needs.releasePlease.outputs.release_created }}
permissions:
contents: "read"
id-token: "write"
uses: ./.github/workflows/operator-reusable-image-build.yml
with:
dockerfile: "operator/Dockerfile"
registry: "docker.io"
organization: "grafana"
image_name: "loki-operator"
tag: ${{ needs.releasePlease.outputs.release_major }}.${{ needs.releasePlease.outputs.release_minor }}.${{ needs.releasePlease.outputs.release_patch }}
publishRelease:
needs:
- "releasePlease"
- "publishImages"
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
pull-requests: "write"
if: ${{ needs.releasePlease.outputs.release_created }}
steps:
- name: Retrieve GitHub App Credentials from Vault
id: get-secrets
uses: grafana/shared-workflows/actions/get-vault-secrets@28361cdb22223e5f1e34358c86c20908e7248760
with:
repo_secrets: |
APP_ID=loki-gh-app:app-id
PRIVATE_KEY=loki-gh-app:private-key
- name: Generate GitHub App Token
id: app-token
uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1
with:
# Variables generated by the previous step get-secrets
app-id: ${{ env.APP_ID }}
private-key: ${{ env.PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: "pull code to release"
uses: "actions/checkout@v5"
with:
persist-credentials: false
path: "release"
- name: "publish release"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
RELEASE_NAME: ${{ needs.releasePlease.outputs.release_name }}
working-directory: "release"
run: |
gh release edit "$RELEASE_NAME" --draft=false --latest=false