From 06a4e05eecc2dde0aab2650a257182170b887d5d Mon Sep 17 00:00:00 2001 From: PalmDevs Date: Sat, 19 Oct 2024 21:49:52 +0700 Subject: [PATCH] ci(publish): add release branch to build info --- .github/workflows/release.yml | 1 + .releaserc | 54 ----------------------------------- .releaserc.js | 53 ++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 54 deletions(-) delete mode 100644 .releaserc create mode 100644 .releaserc.js diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e3469ccf..cffc32bf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,3 +32,4 @@ jobs: run: pnpx semantic-release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASE_BRANCH: ${{ github.ref_name }} diff --git a/.releaserc b/.releaserc deleted file mode 100644 index 1197c8f5..00000000 --- a/.releaserc +++ /dev/null @@ -1,54 +0,0 @@ -{ - "branches": [ - "main", - { - "name": "dev", - "prerelease": true - } - ], - "plugins": [ - [ - "@semantic-release/commit-analyzer", { - "releaseRules": [ - { "type": "build", "scope": "Needs bump", "release": "patch" } - ] - } - ], - "@semantic-release/release-notes-generator", - "@semantic-release/changelog", - [ - "@semantic-release/git", - { - "assets": [ - "README.md", - "CHANGELOG.md" - ], - "message": "chore: Release ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" - } - ], - [ - "@semantic-release/exec", - { - "prepareCmd": "pnpm build" - } - ], - [ - "@semantic-release/github", - { - "assets": [ - { - "path": "dist/*.js" - } - ], - "successComment": false - } - ], - [ - "@saithodev/semantic-release-backmerge", - { - "backmergeBranches": [{"from": "main", "to": "dev"}], - "clearWorkspace": true - } - ] - ] -} \ No newline at end of file diff --git a/.releaserc.js b/.releaserc.js new file mode 100644 index 00000000..5d9fd9db --- /dev/null +++ b/.releaserc.js @@ -0,0 +1,53 @@ +export default { + branches: [ + "main", + { + name: "dev", + prerelease: true, + }, + ], + plugins: [ + [ + "@semantic-release/commit-analyzer", + { + releaseRules: [ + { type: "build", scope: "Needs bump", release: "patch" }, + ], + }, + ], + "@semantic-release/release-notes-generator", + "@semantic-release/changelog", + [ + "@semantic-release/git", + { + assets: ["README.md", "CHANGELOG.md"], + message: + "chore: Release ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}", + }, + ], + [ + "@semantic-release/exec", + { + prepareCmd: `pnpm build --release-branch ${process.env.RELEASE_BRANCH}`, + }, + ], + [ + "@semantic-release/github", + { + assets: [ + { + path: "dist/*.js", + }, + ], + successComment: false, + }, + ], + [ + "@saithodev/semantic-release-backmerge", + { + backmergeBranches: [{ from: "main", to: "dev" }], + clearWorkspace: true, + }, + ], + ], +};