From eb69e4fdc32f5e43d856ee817766964f9ac7897c Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Fri, 22 Dec 2023 14:26:08 +0800 Subject: [PATCH 1/9] chore(build): update Makefile and CI --- .github/workflows/manual-create-pd-pr.yaml | 33 ++++---- .github/workflows/release-check.yaml | 19 ----- .github/workflows/release.yaml | 81 +------------------- .github/workflows/test-docker-image.yaml | 2 +- Makefile | 3 +- ui/.env.development | 2 - ui/packages/tidb-dashboard-for-op/builder.js | 18 ----- 7 files changed, 21 insertions(+), 137 deletions(-) delete mode 100644 .github/workflows/release-check.yaml diff --git a/.github/workflows/manual-create-pd-pr.yaml b/.github/workflows/manual-create-pd-pr.yaml index 5ad191b75c..eca0d947c1 100644 --- a/.github/workflows/manual-create-pd-pr.yaml +++ b/.github/workflows/manual-create-pd-pr.yaml @@ -4,7 +4,11 @@ on: workflow_dispatch: inputs: release_version: - description: "Release version, e.g. v2021.07.09.1" + description: "Release version, e.g. 2021.07.09.1" + required: true + pd_branchs: + description: 'PD branch, e.g. ["master", "release-7.6"]' + default: '["master"]' required: true jobs: @@ -13,7 +17,8 @@ jobs: strategy: fail-fast: false matrix: - branch: [master, release-5.4, release-6.1] + # https://stackoverflow.com/questions/69781005/combine-dynamic-github-workflow-matrix-with-input-values-and-predefined-values + branch: ${{ fromJson(github.event.inputs.pd_branchs) }} name: Create PD PR - ${{ matrix.branch }} steps: - name: Check out PD code base @@ -23,7 +28,7 @@ jobs: ref: ${{ matrix.branch }} - uses: actions/setup-go@v3 with: - go-version: "1.18" + go-version: "1.21" - name: Load go module cache uses: actions/cache@v3 with: @@ -35,23 +40,17 @@ jobs: ${{ runner.os }}-go-pd- - name: Update TiDB Dashboard in PD code base run: | - go get -d "github.com/pingcap/tidb-dashboard@${{ github.event.inputs.release_version }}" - go mod tidy - make pd-server - go mod tidy - cd tests/client - go mod tidy - cd ../.. + scripts/update-dashboard.sh ${{ github.event.inputs.release_version }} - name: Commit PD code base change id: git_commit run: | git diff - git config user.name "tidb-dashboard-bot" - git config user.email "tidb-dashboard-bot@pingcap.com" + git config user.name "baurine" + git config user.email "2008.hbl@gmail.com" git add . if git status | grep -q "Changes to be committed" then - git commit --signoff --message "Update TiDB Dashboard to ${{ github.event.inputs.release_version }}, ref #4257" + git commit --signoff --message "Update TiDB Dashboard to v${{ github.event.inputs.release_version }}" echo "::set-output name=committed::1" else echo "No changes detected, skipped" @@ -65,19 +64,17 @@ jobs: with: token: ${{ secrets.BOT_PAT }} branch: update-tidb-dashboard/${{ matrix.branch }}-${{ github.event.inputs.release_version }}-${{ steps.build_id.outputs.id }} - title: Update TiDB Dashboard to ${{ github.event.inputs.release_version }} [${{ matrix.branch }}] + title: Update TiDB Dashboard to v${{ github.event.inputs.release_version }} [${{ matrix.branch }}] body: | ### What problem does this PR solve? Issue Number: ref #4257 - Update TiDB Dashboard to ${{ github.event.inputs.release_version }}. - - Upstream commit: https://github.com/${{ github.repository }}/commit/${{ github.sha }} . + Update TiDB Dashboard to [v${{ github.event.inputs.release_version }}](https://github.com/pingcap/tidb-dashboard/releases/tag/v${{ github.event.inputs.release_version }}). ### Release note ```release-note None ``` - push-to-fork: tidb-dashboard-bot/pd + push-to-fork: baurine/pd diff --git a/.github/workflows/release-check.yaml b/.github/workflows/release-check.yaml deleted file mode 100644 index f7d61571af..0000000000 --- a/.github/workflows/release-check.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: Release Check - -on: - pull_request: - branches: - - release - -jobs: - check_release_version: - runs-on: ubuntu-latest - steps: - - name: Checkout code and release branch - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Check release version - run: > - ! (git diff --name-only --exit-code origin/release -- ./release-version) - || (echo "Please update the release-version file" && false) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 77264b25aa..be2c9a27a6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -2,8 +2,8 @@ name: Release on: push: - branches: - - release + tags: + - "v*" jobs: release: @@ -40,7 +40,7 @@ jobs: - name: Lookup release version id: lookup_release_version run: | - echo "::set-output name=release_version::$(grep -v '^#' ./release-version)" + echo "::set-output name=release_version::$(git describe --tags --dirty --always)" - name: Build UI env: REACT_APP_MIXPANEL_TOKEN: ${{ secrets.REACT_APP_MIXPANEL_TOKEN }} @@ -85,78 +85,3 @@ jobs: asset_path: ./embedded-assets-golang.zip asset_name: embedded-assets-golang.zip asset_content_type: application/zip - pd_pr: - if: "!contains(github.event.head_commit.message, 'skip pd_pr')" - name: Create PD PR - runs-on: ubuntu-latest - needs: release - strategy: - fail-fast: false - matrix: - branch: [master, release-5.4, release-6.1] - steps: - - name: Check out PD code base - uses: actions/checkout@v3 - with: - repository: tikv/pd - ref: ${{ matrix.branch }} - - uses: actions/setup-go@v3 - with: - go-version: "1.18" - - name: Load go module cache - uses: actions/cache@v3 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-pd-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go-pd- - - name: Update TiDB Dashboard in PD code base - run: | - go get -d "github.com/pingcap/tidb-dashboard@${{ needs.release.outputs.release_version }}" - go mod tidy - make pd-server - go mod tidy - cd tests/client - go mod tidy - cd ../.. - - name: Commit PD code base change - id: git_commit - run: | - git diff - git config user.name "tidb-dashboard-bot" - git config user.email "tidb-dashboard-bot@pingcap.com" - git add . - if git status | grep -q "Changes to be committed" - then - git commit --signoff --message "Update TiDB Dashboard to ${{ needs.release.outputs.release_version }}, ref #4257" - echo "::set-output name=committed::1" - else - echo "No changes detected, skipped" - fi - - name: Set build ID - id: build_id - run: echo "::set-output name=id::$(date +%s)" - - name: Create PR based on PD code base - uses: peter-evans/create-pull-request@v3 - if: steps.git_commit.outputs.committed == 1 - with: - token: ${{ secrets.BOT_PAT }} - branch: update-tidb-dashboard/${{ matrix.branch }}-${{ needs.release.outputs.release_version }}-${{ steps.build_id.outputs.id }} - title: Update TiDB Dashboard to ${{ needs.release.outputs.release_version }} [${{ matrix.branch }}] - body: | - ### What problem does this PR solve? - - Issue Number: ref #4257 - - This is an automatic updating PR for TiDB Dashboard. See #4257 for details. - - This PR updates TiDB Dashboard to ${{ needs.release.outputs.release_version }} for upstream commit: https://github.com/${{ github.repository }}/commit/${{ github.sha }} . - - ### Release note - - ```release-note - None - ``` - push-to-fork: tidb-dashboard-bot/pd diff --git a/.github/workflows/test-docker-image.yaml b/.github/workflows/test-docker-image.yaml index b9ce5ad2d6..372d81243a 100644 --- a/.github/workflows/test-docker-image.yaml +++ b/.github/workflows/test-docker-image.yaml @@ -25,7 +25,7 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Read VERSION file id: getversion - run: echo "::set-output name=version::$(grep -v '^\#' ./release-version)" + run: echo "::set-output name=version::$(git describe --tags --dirty --always)" - name: Build uses: docker/build-push-action@v3 with: diff --git a/Makefile b/Makefile index fadac3e37c..a1b156e02a 100755 --- a/Makefile +++ b/Makefile @@ -14,7 +14,8 @@ E2E_SPEC ?= UI ?= -RELEASE_VERSION := $(shell grep -v '^\#' ./release-version) +# RELEASE_VERSION := $(shell grep -v '^\#' ./release-version) +RELEASE_VERSION ?= $(shell git describe --tags --dirty --always) LDFLAGS += -X "$(DASHBOARD_PKG)/pkg/utils/version.InternalVersion=$(RELEASE_VERSION)" LDFLAGS += -X "$(DASHBOARD_PKG)/pkg/utils/version.Standalone=Yes" diff --git a/ui/.env.development b/ui/.env.development index a688729a85..d802e84ad0 100644 --- a/ui/.env.development +++ b/ui/.env.development @@ -1,7 +1,5 @@ PORT=3001 PUBLIC_URL='/dashboard' REACT_APP_VERSION=$npm_package_version -# REACT_APP_RELEASE_VERSION is set in config-overrides.js -REACT_APP_RELEASE_VERSION=unknown REACT_APP_MIXPANEL_HOST=https://telemetry.pingcap.com/api/v1/dashboard/report REACT_APP_MIXPANEL_TOKEN= \ No newline at end of file diff --git a/ui/packages/tidb-dashboard-for-op/builder.js b/ui/packages/tidb-dashboard-for-op/builder.js index 96607ab3de..8e3bc868a4 100755 --- a/ui/packages/tidb-dashboard-for-op/builder.js +++ b/ui/packages/tidb-dashboard-for-op/builder.js @@ -48,20 +48,6 @@ const devServerParams = { ] } -function getInternalVersion() { - const version = fs - .readFileSync('../../../release-version', 'utf8') - .split(os.EOL) - .map((l) => l.trim()) - .filter((l) => !l.startsWith('#') && l !== '')[0] - if (version === '') { - throw new Error( - `invalid release version, please check the release-version file` - ) - } - return version -} - function genDefine() { const define = {} for (const k in process.env) { @@ -75,10 +61,6 @@ function genDefine() { define[`process.env.${k}`] = JSON.stringify(envVal) } } - // REACT_APP_RELEASE_VERSION was used in sentry before - define['process.env.REACT_APP_RELEASE_VERSION'] = JSON.stringify( - getInternalVersion() - ) define['process.env.E2E_TEST'] = JSON.stringify(process.env.E2E_TEST) return define } From 80d1911361cdad6c64a27b5673c26d410125a22d Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Fri, 22 Dec 2023 23:03:08 +0800 Subject: [PATCH 2/9] chore(build): add script to auto create release tag --- Makefile | 4 +++ scripts/create_release_tag.js | 57 +++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 scripts/create_release_tag.js diff --git a/Makefile b/Makefile index a1b156e02a..c609654b92 100755 --- a/Makefile +++ b/Makefile @@ -159,6 +159,10 @@ docker-build-image-locally-arm64: clean docker buildx build ${NO_CACHE} --load -t $(IMAGE) --platform $(ARM64) -f $(DOCKERFILE) . docker run --rm $(IMAGE) -v +.PHONY: tag +tag: + node scripts/create_release_tag.js + .PHONY: run # please ensure that tiup playground is running in the background. run: bin/tidb-dashboard --debug --experimental --feature-version "$(FEATURE_VERSION)" --host 0.0.0.0 diff --git a/scripts/create_release_tag.js b/scripts/create_release_tag.js new file mode 100644 index 0000000000..938cfe02ce --- /dev/null +++ b/scripts/create_release_tag.js @@ -0,0 +1,57 @@ +// This scripts is used to create a new release tag for the current release branch +// when we need to submit a PR to PD for updating the tidb-dashboard. +// After this tag is pushed, it will trigger the CI to build a new tidb-dashboard release version. +// Then we can run the manual-create-pd-pr.yaml workflow in the GitHub to create a PR to PD. + +const { execSync } = require('child_process'); + +function getGitBranch() { + // master, release-7.6 + return execSync('git rev-parse --abbrev-ref HEAD').toString().trim(); +} + +function getGitShortSha() { + // eb69e4fd + return execSync('git rev-parse --short HEAD').toString().trim(); +} + +function getGitLatestTag() { + // v7.6.0-alpha, v7.6.0-, v7.6.0, v7.6.1-, v7.6.1 + return execSync('git describe --tags --dirty --always').toString().trim(); +} + +function createReleaseTag() { + const branch = getGitBranch(); + + if (!branch.match(/release-\d.\d$/)) { + console.error('Err: this is not a valid release branch'); + return + } + + const branchVer = branch.replace('release-', ''); + const latestTag = getGitLatestTag(); + + if (!latestTag.startsWith(`v${branchVer}.`)) { + console.error(`Err: latest tag ${latestTag} doesn't match the branch ${branch}, you need to add the new tag manually`); + return + } + + const shortSha = getGitShortSha(); + const splitPos = latestTag.indexOf('-'); + let nextTag = '' + if (splitPos === -1) { + // the latest tag likes v7.6.0, v7.6.1 + // then the next tag should be v7.6.1- for v7.6.0, v7.6.2- for v7.6.1 + const suffix = latestTag.replace(`v${branchVer}.`, ''); + nextTag = `v${branchVer}.${parseInt(suffix) + 1}-${shortSha}`; + } else { + // the latest tag likes v7.6.0-, v7.6.1- + // then the next tag should be v7.6.0- for v7.6.0-, v7.6.1- for v7.6.1- + const prefix = latestTag.substring(0, splitPos); + nextTag = `${prefix}-${shortSha}`; + } + execSync(`git tag ${nextTag}`); + console.log(`Created tag ${nextTag}`) +} + +createReleaseTag() From 6cfa7ba928034ad5b1f31db05ce12d1e22d2f75a Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Fri, 22 Dec 2023 23:34:39 +0800 Subject: [PATCH 3/9] refine --- .github/workflows/release.yaml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index be2c9a27a6..236251e4c6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,13 +4,12 @@ on: push: tags: - "v*" + - "!v*-alpha" jobs: release: name: Release runs-on: ubuntu-latest - outputs: - release_version: v${{ steps.lookup_release_version.outputs.release_version }} steps: - name: Checkout code uses: actions/checkout@v3 @@ -37,10 +36,6 @@ jobs: key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - - name: Lookup release version - id: lookup_release_version - run: | - echo "::set-output name=release_version::$(git describe --tags --dirty --always)" - name: Build UI env: REACT_APP_MIXPANEL_TOKEN: ${{ secrets.REACT_APP_MIXPANEL_TOKEN }} @@ -56,8 +51,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: v${{ steps.lookup_release_version.outputs.release_version }} - release_name: Internal Version ${{ steps.lookup_release_version.outputs.release_version }} + tag_name: ${{ github.ref }} + release_name: Internal Version ${{ github.ref }} draft: false prerelease: false - name: Upload UI assets From 99132e73d692d9306ed6f14e14c142cf732c8d84 Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Mon, 25 Dec 2023 13:42:08 +0800 Subject: [PATCH 4/9] chore: add doc --- CONTRIBUTING.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ab3215d133..7378249ea6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -150,6 +150,16 @@ If you want to develop docker image locally 🤔. > The old Dashboard **_in PD_** can be accessed at [http://localhost:2379/dashboard](http://localhost:2379/dashboard). +### How to update TiDB Dashboard in PD + +To update the TiDB Dashboard in PD, we need to release a TiDB Dashboard version and submit a PR to PD. + +1. In a release branch, likes `release-7.6`, run `make tag` to add a new tag for TiDB Dashboard. The new tag is like `v7.6.x-`. + +1. Push the new tag to the remote repository, it will trigger the CI to release a new TiDB Dashboard version. + +1. After the new version is created, go to https://github.com/pingcap/tidb-dashboard/actions/workflows/manual-create-pd-pr.yaml, click `Run workflow` button, fill the required parameters and submit the workflow, it will trigger the CI to create a PR to PD which will update the TiDB Dashboard version in PD. + ## Contribution flow This is a rough outline of what a contributor's workflow looks like: From f7bbcdcf902c011552b1c97cd450ad1f741b6462 Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Thu, 28 Dec 2023 18:07:58 +0800 Subject: [PATCH 5/9] remove -fips suffix --- Makefile | 4 +--- scripts/create_release_tag.js | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index c609654b92..916f206f45 100755 --- a/Makefile +++ b/Makefile @@ -14,8 +14,7 @@ E2E_SPEC ?= UI ?= -# RELEASE_VERSION := $(shell grep -v '^\#' ./release-version) -RELEASE_VERSION ?= $(shell git describe --tags --dirty --always) +RELEASE_VERSION := $(shell git describe --tags --dirty --always) LDFLAGS += -X "$(DASHBOARD_PKG)/pkg/utils/version.InternalVersion=$(RELEASE_VERSION)" LDFLAGS += -X "$(DASHBOARD_PKG)/pkg/utils/version.Standalone=Yes" @@ -38,7 +37,6 @@ NO_CACHE ?= BUILD_GOEXPERIMENT ?= BUILD_CGO_ENABLED ?= ifeq ("${ENABLE_FIPS}", "1") - RELEASE_VERSION := $(RELEASE_VERSION)-fips BUILD_TAGS += boringcrypto BUILD_GOEXPERIMENT = GOEXPERIMENT=boringcrypto BUILD_CGO_ENABLED = CGO_ENABLED=1 diff --git a/scripts/create_release_tag.js b/scripts/create_release_tag.js index 938cfe02ce..5d80af894d 100644 --- a/scripts/create_release_tag.js +++ b/scripts/create_release_tag.js @@ -29,7 +29,7 @@ function createReleaseTag() { } const branchVer = branch.replace('release-', ''); - const latestTag = getGitLatestTag(); + const latestTag = getGitLatestTag().replace('-fips', ''); if (!latestTag.startsWith(`v${branchVer}.`)) { console.error(`Err: latest tag ${latestTag} doesn't match the branch ${branch}, you need to add the new tag manually`); From 918705cfe1f44051fb0f9f501e62ab281034bd77 Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Fri, 29 Dec 2023 13:46:23 +0800 Subject: [PATCH 6/9] refine --- .github/workflows/manual-create-pd-pr.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/manual-create-pd-pr.yaml b/.github/workflows/manual-create-pd-pr.yaml index eca0d947c1..9f52b9a73e 100644 --- a/.github/workflows/manual-create-pd-pr.yaml +++ b/.github/workflows/manual-create-pd-pr.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: release_version: - description: "Release version, e.g. 2021.07.09.1" + description: "Release version, e.g. v7.6.0-f7bbcdcf" required: true pd_branchs: description: 'PD branch, e.g. ["master", "release-7.6"]' @@ -50,7 +50,7 @@ jobs: git add . if git status | grep -q "Changes to be committed" then - git commit --signoff --message "Update TiDB Dashboard to v${{ github.event.inputs.release_version }}" + git commit --signoff --message "Update TiDB Dashboard to ${{ github.event.inputs.release_version }}" echo "::set-output name=committed::1" else echo "No changes detected, skipped" @@ -64,13 +64,13 @@ jobs: with: token: ${{ secrets.BOT_PAT }} branch: update-tidb-dashboard/${{ matrix.branch }}-${{ github.event.inputs.release_version }}-${{ steps.build_id.outputs.id }} - title: Update TiDB Dashboard to v${{ github.event.inputs.release_version }} [${{ matrix.branch }}] + title: Update TiDB Dashboard to ${{ github.event.inputs.release_version }} [${{ matrix.branch }}] body: | ### What problem does this PR solve? Issue Number: ref #4257 - Update TiDB Dashboard to [v${{ github.event.inputs.release_version }}](https://github.com/pingcap/tidb-dashboard/releases/tag/v${{ github.event.inputs.release_version }}). + Update TiDB Dashboard to [${{ github.event.inputs.release_version }}](https://github.com/pingcap/tidb-dashboard/releases/tag/${{ github.event.inputs.release_version }}). ### Release note From 1101a53258d0ff6458d2183d7fa49638732c1aee Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Fri, 29 Dec 2023 14:13:36 +0800 Subject: [PATCH 7/9] update push token --- .github/workflows/manual-create-pd-pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manual-create-pd-pr.yaml b/.github/workflows/manual-create-pd-pr.yaml index 9f52b9a73e..c02f415b2f 100644 --- a/.github/workflows/manual-create-pd-pr.yaml +++ b/.github/workflows/manual-create-pd-pr.yaml @@ -62,7 +62,7 @@ jobs: uses: peter-evans/create-pull-request@v3 if: steps.git_commit.outputs.committed == 1 with: - token: ${{ secrets.BOT_PAT }} + token: ${{ secrets.PAT_TO_PUSH_PD_FORK }} branch: update-tidb-dashboard/${{ matrix.branch }}-${{ github.event.inputs.release_version }}-${{ steps.build_id.outputs.id }} title: Update TiDB Dashboard to ${{ github.event.inputs.release_version }} [${{ matrix.branch }}] body: | From 15fb3693bcc1e12e8a0cd3a47f3994103ba037af Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Fri, 29 Dec 2023 16:52:29 +0800 Subject: [PATCH 8/9] generate changelog when release --- .github/workflows/manual-create-pd-pr.yaml | 12 +++++++++--- .github/workflows/release.yaml | 7 +++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/manual-create-pd-pr.yaml b/.github/workflows/manual-create-pd-pr.yaml index c02f415b2f..4dcd3f57a0 100644 --- a/.github/workflows/manual-create-pd-pr.yaml +++ b/.github/workflows/manual-create-pd-pr.yaml @@ -50,7 +50,7 @@ jobs: git add . if git status | grep -q "Changes to be committed" then - git commit --signoff --message "Update TiDB Dashboard to ${{ github.event.inputs.release_version }}" + git commit --signoff --message "chore(dashboard): update TiDB Dashboard to ${{ github.event.inputs.release_version }}" echo "::set-output name=committed::1" else echo "No changes detected, skipped" @@ -59,12 +59,14 @@ jobs: id: build_id run: echo "::set-output name=id::$(date +%s)" - name: Create PR based on PD code base + id: cpr uses: peter-evans/create-pull-request@v3 if: steps.git_commit.outputs.committed == 1 with: + push-to-fork: baurine/pd token: ${{ secrets.PAT_TO_PUSH_PD_FORK }} branch: update-tidb-dashboard/${{ matrix.branch }}-${{ github.event.inputs.release_version }}-${{ steps.build_id.outputs.id }} - title: Update TiDB Dashboard to ${{ github.event.inputs.release_version }} [${{ matrix.branch }}] + title: "chore(dashboard): update TiDB Dashboard to ${{ github.event.inputs.release_version }} [${{ matrix.branch }}]" body: | ### What problem does this PR solve? @@ -77,4 +79,8 @@ jobs: ```release-note None ``` - push-to-fork: baurine/pd + - name: Check outputs + if: steps.git_commit.outputs.committed == 1 + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 236251e4c6..4ac56d7889 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -36,6 +36,7 @@ jobs: key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- + - name: Build UI env: REACT_APP_MIXPANEL_TOKEN: ${{ secrets.REACT_APP_MIXPANEL_TOKEN }} @@ -45,6 +46,10 @@ jobs: working-directory: ui/packages/tidb-dashboard-for-op/dist run: | zip -r ../static-assets.zip . + + - name: Generate Changelog + id: build_changelog + uses: mikepenz/release-changelog-builder-action@v4.1.0 - name: Create release id: create_release uses: fleskesvor/create-release@feature/support-target-commitish @@ -55,6 +60,8 @@ jobs: release_name: Internal Version ${{ github.ref }} draft: false prerelease: false + body: ${{steps.build_changelog.outputs.changelog}} + - name: Upload UI assets uses: actions/upload-release-asset@v1.0.1 env: From 0acbdd23a9d901308c49690a75c5bcae768fe3aa Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Fri, 29 Dec 2023 17:33:02 +0800 Subject: [PATCH 9/9] refine --- .github/workflows/release.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4ac56d7889..03995c8d09 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -47,9 +47,10 @@ jobs: run: | zip -r ../static-assets.zip . - - name: Generate Changelog - id: build_changelog - uses: mikepenz/release-changelog-builder-action@v4.1.0 + # TODO: generate changelog + # - name: Generate Changelog + # id: build_changelog + # uses: mikepenz/release-changelog-builder-action@v4.1.0 - name: Create release id: create_release uses: fleskesvor/create-release@feature/support-target-commitish @@ -60,7 +61,7 @@ jobs: release_name: Internal Version ${{ github.ref }} draft: false prerelease: false - body: ${{steps.build_changelog.outputs.changelog}} + # body: ${{steps.build_changelog.outputs.changelog}} - name: Upload UI assets uses: actions/upload-release-asset@v1.0.1