grafana/.github/workflows/publish-kinds-next.yml

64 lines
2.0 KiB
YAML
Raw Normal View History

Kinds: publish kinds to kind registry (#67515) * Start local schema registry * Try to use latest version * Revert "Try to use latest version" This reverts commit 682385c0e4cef8f623d88fe9a2e83cdb412036a7. * update schema registry jenny to validate new lineages * save kind instead of lineage * handle plugins * get published schemas from GH + fix plugins * handle kind not yet published * Add script to use in workflow + handle maturity * first pass on publish-kinds GH workflow * fix script path * remove unused script * use make gen-cue instead of script * trigger publish-kinds on every commit (for test) * temporary update to use specific thema commit * wrapping errors * remove GH token & refactor for rate limit * Update publish-kinds.yml * Update publish-kinds.yml * revert go.mod and go.sum updates * use Thema specific commit * Kind registry v2 * fix script path * fix second script path * update go.mod * update schema registry source * test checks * add GITHUB_TOKEN * revert test checks * actually write next files when publishing * Add kind set arg * Add comments * clean up workflows * update Thema * Update .betterer.results * few fixes after lineage flattening * Update publish-kinds-next.yml * add codeowners for new files * update thema * apply review feedback * update go version in workflows * clean up workflows * Add step to generate token and test * Update publish-kinds-next.yml * fix script * try with the app name * Update publish-kinds-next.yml * clean up and update release workflow * add comment * publish kinds only on cue updates
2023-06-13 07:01:29 -05:00
name: "publish-kinds-next"
on:
push:
branches:
- "main"
paths:
- '**/*.cue'
workflow_dispatch:
jobs:
config:
runs-on: "ubuntu-latest"
if: github.repository == 'grafana/grafana'
outputs:
has-secrets: ${{ steps.check.outputs.has-secrets }}
steps:
- name: "Check for secrets"
id: check
shell: bash
run: |
if [ -n "${{ (secrets.GRAFANA_DELIVERY_BOT_APP_ID != '' &&secrets.GRAFANA_DELIVERY_BOT_APP_PEM != '') || '' }}" ]; then
echo "has-secrets=1" >> "$GITHUB_OUTPUT"
fi
Kinds: publish kinds to kind registry (#67515) * Start local schema registry * Try to use latest version * Revert "Try to use latest version" This reverts commit 682385c0e4cef8f623d88fe9a2e83cdb412036a7. * update schema registry jenny to validate new lineages * save kind instead of lineage * handle plugins * get published schemas from GH + fix plugins * handle kind not yet published * Add script to use in workflow + handle maturity * first pass on publish-kinds GH workflow * fix script path * remove unused script * use make gen-cue instead of script * trigger publish-kinds on every commit (for test) * temporary update to use specific thema commit * wrapping errors * remove GH token & refactor for rate limit * Update publish-kinds.yml * Update publish-kinds.yml * revert go.mod and go.sum updates * use Thema specific commit * Kind registry v2 * fix script path * fix second script path * update go.mod * update schema registry source * test checks * add GITHUB_TOKEN * revert test checks * actually write next files when publishing * Add kind set arg * Add comments * clean up workflows * update Thema * Update .betterer.results * few fixes after lineage flattening * Update publish-kinds-next.yml * add codeowners for new files * update thema * apply review feedback * update go version in workflows * clean up workflows * Add step to generate token and test * Update publish-kinds-next.yml * fix script * try with the app name * Update publish-kinds-next.yml * clean up and update release workflow * add comment * publish kinds only on cue updates
2023-06-13 07:01:29 -05:00
main:
needs: config
if: github.repository == 'grafana/grafana' && needs.config.outputs.has-secrets
Kinds: publish kinds to kind registry (#67515) * Start local schema registry * Try to use latest version * Revert "Try to use latest version" This reverts commit 682385c0e4cef8f623d88fe9a2e83cdb412036a7. * update schema registry jenny to validate new lineages * save kind instead of lineage * handle plugins * get published schemas from GH + fix plugins * handle kind not yet published * Add script to use in workflow + handle maturity * first pass on publish-kinds GH workflow * fix script path * remove unused script * use make gen-cue instead of script * trigger publish-kinds on every commit (for test) * temporary update to use specific thema commit * wrapping errors * remove GH token & refactor for rate limit * Update publish-kinds.yml * Update publish-kinds.yml * revert go.mod and go.sum updates * use Thema specific commit * Kind registry v2 * fix script path * fix second script path * update go.mod * update schema registry source * test checks * add GITHUB_TOKEN * revert test checks * actually write next files when publishing * Add kind set arg * Add comments * clean up workflows * update Thema * Update .betterer.results * few fixes after lineage flattening * Update publish-kinds-next.yml * add codeowners for new files * update thema * apply review feedback * update go version in workflows * clean up workflows * Add step to generate token and test * Update publish-kinds-next.yml * fix script * try with the app name * Update publish-kinds-next.yml * clean up and update release workflow * add comment * publish kinds only on cue updates
2023-06-13 07:01:29 -05:00
runs-on: "ubuntu-latest"
steps:
- name: "Checkout Grafana repo"
uses: "actions/checkout@v4"
Kinds: publish kinds to kind registry (#67515) * Start local schema registry * Try to use latest version * Revert "Try to use latest version" This reverts commit 682385c0e4cef8f623d88fe9a2e83cdb412036a7. * update schema registry jenny to validate new lineages * save kind instead of lineage * handle plugins * get published schemas from GH + fix plugins * handle kind not yet published * Add script to use in workflow + handle maturity * first pass on publish-kinds GH workflow * fix script path * remove unused script * use make gen-cue instead of script * trigger publish-kinds on every commit (for test) * temporary update to use specific thema commit * wrapping errors * remove GH token & refactor for rate limit * Update publish-kinds.yml * Update publish-kinds.yml * revert go.mod and go.sum updates * use Thema specific commit * Kind registry v2 * fix script path * fix second script path * update go.mod * update schema registry source * test checks * add GITHUB_TOKEN * revert test checks * actually write next files when publishing * Add kind set arg * Add comments * clean up workflows * update Thema * Update .betterer.results * few fixes after lineage flattening * Update publish-kinds-next.yml * add codeowners for new files * update thema * apply review feedback * update go version in workflows * clean up workflows * Add step to generate token and test * Update publish-kinds-next.yml * fix script * try with the app name * Update publish-kinds-next.yml * clean up and update release workflow * add comment * publish kinds only on cue updates
2023-06-13 07:01:29 -05:00
with:
fetch-depth: 0
- name: "Setup Go"
uses: "actions/setup-go@v4"
with:
2023-10-11 08:49:24 -05:00
go-version: '1.20.10'
Kinds: publish kinds to kind registry (#67515) * Start local schema registry * Try to use latest version * Revert "Try to use latest version" This reverts commit 682385c0e4cef8f623d88fe9a2e83cdb412036a7. * update schema registry jenny to validate new lineages * save kind instead of lineage * handle plugins * get published schemas from GH + fix plugins * handle kind not yet published * Add script to use in workflow + handle maturity * first pass on publish-kinds GH workflow * fix script path * remove unused script * use make gen-cue instead of script * trigger publish-kinds on every commit (for test) * temporary update to use specific thema commit * wrapping errors * remove GH token & refactor for rate limit * Update publish-kinds.yml * Update publish-kinds.yml * revert go.mod and go.sum updates * use Thema specific commit * Kind registry v2 * fix script path * fix second script path * update go.mod * update schema registry source * test checks * add GITHUB_TOKEN * revert test checks * actually write next files when publishing * Add kind set arg * Add comments * clean up workflows * update Thema * Update .betterer.results * few fixes after lineage flattening * Update publish-kinds-next.yml * add codeowners for new files * update thema * apply review feedback * update go version in workflows * clean up workflows * Add step to generate token and test * Update publish-kinds-next.yml * fix script * try with the app name * Update publish-kinds-next.yml * clean up and update release workflow * add comment * publish kinds only on cue updates
2023-06-13 07:01:29 -05:00
- name: "Verify kinds"
run: go run .github/workflows/scripts/kinds/verify-kinds.go
- name: "Generate token"
id: generate_token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
app_id: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
private_key: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
- name: "Clone website-sync Action"
run: "git clone --single-branch --no-tags --depth 1 -b master https://grafana-delivery-bot:${{ steps.generate_token.outputs.token }}@github.com/grafana/website-sync ./.github/actions/website-sync"
- name: "Publish to kind registry (next)"
uses: "./.github/actions/website-sync"
id: "publish-next"
with:
repository: "grafana/kind-registry"
branch: "main"
host: "github.com"
github_pat: "grafana-delivery-bot:${{ steps.generate_token.outputs.token }}"
source_folder: ".github/workflows/scripts/kinds/next"
target_folder: "grafana/next"