Semanti c -Release - предварительная версия не увеличивается для патча, минорной или основной версии - PullRequest
2 голосов
/ 03 апреля 2020

Текущее поведение

Это совершенно новый проект, поэтому fre sh version et c.

В настоящее время имеется ветвь предварительного выпуска, называемая "next", ветвь релиза, называемая «стабильный», все функции все работали в нашей ветке «разработка», и они имеют правильное умение (тест): это сообщения о фиксации теста.

Из ветки разработки мы создаем запрос на извлечение в «следующий» ». Как только мы довольны тем, как это выглядит и c, мы объединяем нашу ветку "разработка" с нашей "стабильной".

First pu sh для "next" создает тег v1.0.0-next .1.

Тем не менее, другой коммит feat не увеличивает версию до v1.1.0-next.1. Он просто создает v1.0.0-next.2.

Если я затем вытягиваю запросите нашу ветку "разработка" в нашей "стабильной" ветке релиза, она обновляет версии правильно, как это должно быть, например, v1.1.0 выходит.

В моем пакете ветки разработки установлена ​​следующая версия. json

"версия": "0.0.0-следующая", также моя версия не увеличивается в пакете. json, как это было, когда я запускал ее локально, для любой из ветвей.

Ожидаемое поведение Ожидаемое поведение будет иметь приращение версии до выпуска, как обычно, также мой пакет. json обновление.

версии пакета

semanti c -релизная версия: "@ semanti c -релиз": "^ 17.0.4", "@ semanti c -release / changelog ":" ^ 5.0.1 "," @ semanti c -release / commit-analyzer ":" ^ 8.0.1 "," @ semanti c -release / git ":" ^ 9.0.0 "," @ semanti c -release / npm ":" ^ 7.0.5 "," @ semanti c -release / release-notes-generator ":" ^ 9.0.1 ",

Окружение CI:

CircleCI

Используемые плагины:

{
"branches": ["stable", {name: "next", prerelease: true}],
"repositoryUrl": "https://x-token-auth:BB_TOKEN@bitbucket.org/{user}/{repo}.git",
"ci": true,
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/changelog", {
"changelogFile": "./README.md",
}],
"@semantic-release/npm",
["@semantic-release/git", {
"assets": ["./README.md"],
}],
]
}

Журналы CI:


    !/bin/bash -eo pipefail
    npx semantic-release --debug
    [6:41:17 AM] [semantic-release] › ℹ Running semantic-release version 17.0.4
    semantic-release:config load config from: /home/circleci/project/.releaserc +0ms
    semantic-release:config options values: {
    semantic-release:config branches: [ 'stable', { name: 'next', prerelease: true } ],
    semantic-release:config repositoryUrl: 'https://x-token-auth: {BB-TOKEN} @bitbucket.org/repo/ui_kit.git',
    semantic-release:config tagFormat: 'v${version}',
    semantic-release:config plugins: [
    semantic-release:config '@semantic-release/commit-analyzer',
    semantic-release:config '@semantic-release/release-notes-generator',
    semantic-release:config [ '@semantic-release/changelog', [Object] ],
    semantic-release:config '@semantic-release/npm',
    semantic-release:config [ '@semantic-release/git', [Object] ]
    semantic-release:config ],
    semantic-release:config ci: true,
    semantic-release:config _: [],
    semantic-release:config debug: true,
    semantic-release:config '$0': 'node_modules/.bin/semantic-release'
    semantic-release:config } +1ms
    semantic-release:plugins options for @semantic-release/changelog/verifyConditions: { changelogFile: './README.md' } +0ms
    [6:41:17 AM] [semantic-release] › ✔ Loaded plugin "verifyConditions" from "@semantic-release/changelog"
    semantic-release:plugins options for @semantic-release/npm/verifyConditions: {} +1ms
    [6:41:17 AM] [semantic-release] › ✔ Loaded plugin "verifyConditions" from "@semantic-release/npm"
    semantic-release:plugins options for @semantic-release/git/verifyConditions: { assets: [ './README.md' ] } +1ms
    [6:41:17 AM] [semantic-release] › ✔ Loaded plugin "verifyConditions" from "@semantic-release/git"
    semantic-release:plugins options for @semantic-release/commit-analyzer/analyzeCommits: {} +0ms
    [6:41:17 AM] [semantic-release] › ✔ Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
    semantic-release:plugins options for @semantic-release/release-notes-generator/generateNotes: {} +0ms
    [6:41:17 AM] [semantic-release] › ✔ Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
    semantic-release:plugins options for @semantic-release/changelog/prepare: { changelogFile: './README.md' } +1ms
    [6:41:17 AM] [semantic-release] › ✔ Loaded plugin "prepare" from "@semantic-release/changelog"
    semantic-release:plugins options for @semantic-release/npm/prepare: {} +0ms
    [6:41:17 AM] [semantic-release] › ✔ Loaded plugin "prepare" from "@semantic-release/npm"
    semantic-release:plugins options for @semantic-release/git/prepare: { assets: [ './README.md' ] } +0ms
    [6:41:17 AM] [semantic-release] › ✔ Loaded plugin "prepare" from "@semantic-release/git"
    semantic-release:plugins options for @semantic-release/npm/publish: {} +0ms
    [6:41:17 AM] [semantic-release] › ✔ Loaded plugin "publish" from "@semantic-release/npm"
    semantic-release:plugins options for @semantic-release/npm/addChannel: {} +1ms
    [6:41:17 AM] [semantic-release] › ✔ Loaded plugin "addChannel" from "@semantic-release/npm"
    semantic-release:get-tags found tags for branch stable: [] +0ms
    semantic-release:get-tags found tags for branch next: [ { gitTag: 'v1.0.0-next.1', version: '1.0.0-next.1', channels: [ 'next' ] } ] +12ms
    [6:41:20 AM] [semantic-release] › ✔ Run automated release from branch next on repository https://x-token-auth:{BB_TOKEN}@bitbucket.org/repol/ui_kit.git
    [6:41:20 AM] [semantic-release] › ✔ Allowed to push to the Git repository
    [6:41:20 AM] [semantic-release] › ℹ Start step "verifyConditions" of plugin "@semantic-release/changelog"
    [6:41:20 AM] [semantic-release] › ✔ Completed step "verifyConditions" of plugin "@semantic-release/changelog"
    [6:41:20 AM] [semantic-release] › ℹ Start step "verifyConditions" of plugin "@semantic-release/npm"
    [6:41:20 AM] [semantic-release] [@semantic-release/npm] › ℹ Verify authentication for registry https://registry.npmjs.org/
    [6:41:20 AM] [semantic-release] [@semantic-release/npm] › ℹ Reading npm config from /home/circleci/project/.npmrc
    monarc
    [6:41:21 AM] [semantic-release] › ✔ Completed step "verifyConditions" of plugin "@semantic-release/npm"
    [6:41:21 AM] [semantic-release] › ℹ Start step "verifyConditions" of plugin "@semantic-release/git"
    [6:41:21 AM] [semantic-release] › ✔ Completed step "verifyConditions" of plugin "@semantic-release/git"
    [6:41:21 AM] [semantic-release] › ℹ Found git tag v1.0.0-next.1 associated with version 1.0.0-next.1 on branch next
    semantic-release:get-commits Use from: 55f99bb238d96062ec73a9dadc2623a7afe8ad62 +0ms
    [6:41:21 AM] [semantic-release] › ℹ Found 2 commits since last release
    semantic-release:get-commits Parsed commits: [ { commit: { long: '27c780e14a70bc1558a4e68f795963b6886e45a1', short: '27c780e' }, tree: { long: 'c60fdbf8b833a81ec2b7985094eb6c89b910daa4', short: 'c60fdbf' }, author: { name: ', email: '', date: 2020-04-02T06:40:27.000Z }, committer: { name: 'Dev Ops', email: '', date: 2020-04-02T06:40:27.000Z }, subject: 'Merged in development (pull request #139)', body: 'feat(semver3): next #3\n', hash: '27c780e14a70bc1558a4e68f795963b6886e45a1', committerDate: 2020-04-02T06:40:27.000Z, message: 'Merged in development (pull request #139)\n\nfeat(semver3): next #3', gitTags: '(HEAD -> next, origin/next, master)' }, { commit: { long: '99f14f6759801f942a372000356da552f7427d78', short: '99f14f6' }, tree: { long: '5c6666840eec5cdfd21e8a2032933e7735544e30', short: '5c66668' }, author: { name:{name}, email: '', date: 2020-04-02T06:39:46.000Z }, committer: { name: {name}, email: ', date: 2020-04-02T06:39:46.000Z }, subject: 'feat(semver3): next #3', body: '', hash: '99f14f6759801f942a372000356da552f7427d78', committerDate: 2020-04-02T06:39:46.000Z, message: 'feat(semver3): next #3', gitTags: '(origin/development)' } ] +15ms
    [6:41:21 AM] [semantic-release] › ℹ Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
    [6:41:21 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ Analyzing commit: Merged in development (pull request #139)

    feat(semver3): next #3
    semantic-release:commit-analyzer Analyzing with default rules +0ms
    [6:41:21 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ The commit should not trigger a release
    [6:41:21 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ Analyzing commit: feat(semver3): next #3
    semantic-release:commit-analyzer Analyzing with default rules +1ms
    semantic-release:commit-analyzer The rule { type: 'feat', release: 'minor' } match commit with release type 'minor' +0ms
    [6:41:21 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ The release type for the commit is minor
    [6:41:21 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ Analysis of 2 commits complete: minor release
    [6:41:21 AM] [semantic-release] › ✔ Completed step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
    [6:41:21 AM] [semantic-release] › ℹ The next release version is 1.0.0-next.2
    [6:41:21 AM] [semantic-release] › ℹ Start step "generateNotes" of plugin "@semantic-release/release-notes-generator"
    semantic-release:release-notes-generator version: '1.0.0-next.2' +0ms
    semantic-release:release-notes-generator host: undefined +0ms
    semantic-release:release-notes-generator owner: 'monarc_dev' +0ms
    semantic-release:release-notes-generator repository: 'ui_kit' +0ms
    semantic-release:release-notes-generator previousTag: 'v1.0.0-next.1' +0ms
    semantic-release:release-notes-generator currentTag: 'v1.0.0-next.2' +0ms
    semantic-release:release-notes-generator host: 'https://bitbucket.org' +0ms
    semantic-release:release-notes-generator linkReferences: undefined +0ms
    semantic-release:release-notes-generator issue: 'issue' +0ms
    semantic-release:release-notes-generator commit: 'commits' +0ms
    [6:41:21 AM] [semantic-release] › ✔ Completed step "generateNotes" of plugin "@semantic-release/release-notes-generator"
    [6:41:21 AM] [semantic-release] › ℹ Start step "prepare" of plugin "@semantic-release/changelog"
    [6:41:21 AM] [semantic-release] [@semantic-release/changelog] › ℹ Update /home/circleci/project/README.md
    [6:41:21 AM] [semantic-release] › ✔ Completed step "prepare" of plugin "@semantic-release/changelog"
    [6:41:21 AM] [semantic-release] › ℹ Start step "prepare" of plugin "@semantic-release/npm"
    [6:41:21 AM] [semantic-release] [@semantic-release/npm] › ℹ Write version 1.0.0-next.2 to package.json in /home/circleci/project
    v1.0.0-next.2
    [6:41:21 AM] [semantic-release] › ✔ Completed step "prepare" of plugin "@semantic-release/npm"
    [6:41:21 AM] [semantic-release] › ℹ Start step "prepare" of plugin "@semantic-release/git"
    [6:41:22 AM] [semantic-release] [@semantic-release/git] › ℹ Found 1 file(s) to commit
    semantic-release:git add file to git index {
    command: 'git add --force --ignore-errors README.md',
    exitCode: 0,
    stdout: '',
    stderr: '',
    all: undefined,
    failed: false,
    timedOut: false,
    isCanceled: false,
    killed: false
    } +0ms
    semantic-release:git commited files: [ 'README.md' ] +0ms
    [6:41:23 AM] [semantic-release] [@semantic-release/git] › ℹ Prepared Git release: v1.0.0-next.2
    [6:41:23 AM] [semantic-release] › ✔ Completed step "prepare" of plugin "@semantic-release/git"
    [6:41:23 AM] [semantic-release] › ℹ Start step "generateNotes" of plugin "@semantic-release/release-notes-generator"
    semantic-release:release-notes-generator version: '1.0.0-next.2' +2s
    semantic-release:release-notes-generator host: undefined +0ms
    semantic-release:release-notes-generator owner: 'monarc_dev' +0ms
    semantic-release:release-notes-generator repository: 'ui_kit' +0ms
    semantic-release:release-notes-generator previousTag: 'v1.0.0-next.1' +0ms
    semantic-release:release-notes-generator currentTag: 'v1.0.0-next.2' +1ms
    semantic-release:release-notes-generator host: 'https://bitbucket.org' +0ms
    semantic-release:release-notes-generator linkReferences: undefined +0ms
    semantic-release:release-notes-generator issue: 'issue' +0ms
    semantic-release:release-notes-generator commit: 'commits' +0ms
    [6:41:23 AM] [semantic-release] › ✔ Completed step "generateNotes" of plugin "@semantic-release/release-notes-generator"
    [6:41:25 AM] [semantic-release] › ✔ Created tag v1.0.0-next.2
    [6:41:25 AM] [semantic-release] › ℹ Start step "publish" of plugin "@semantic-release/npm"
    [6:41:25 AM] [semantic-release] [@semantic-release/npm] › ℹ Publishing version 1.0.0-next.2 to npm registry on dist-tag next
    npm notice
    npm notice package @monarc-dev/react-toolkit@1.0.0-next.2
    npm notice === Tarball Contents ===
    npm notice 3.0kB package.json
    npm notice 8.8kB README.md
    npm notice === Tarball Details ===
    npm notice name: @monarc-dev/react-toolkit
    npm notice version: 1.0.0-next.2
    npm notice package size: 3.0 kB
    npm notice unpacked size: 11.8 kB
    npm notice shasum: 3abdccb17e58f8e116ffe1dcc6d6271592e4390c
    npm notice integrity: sha512-GOjVWbDMbPyTr[...]KoK2fsQsoPUHg==
    npm notice total files: 2
    npm notice

    @monarc-dev/react-toolkit@1.0.0-next.2
    [6:41:28 AM] [semantic-release] [@semantic-release/npm] › ℹ Published @monarc-dev/react-toolkit@1.0.0-next.2 to dist-tag @next on https://registry.npmjs.org/
    [6:41:28 AM] [semantic-release] › ✔ Completed step "publish" of plugin "@semantic-release/npm"
    [6:41:28 AM] [semantic-release] › ✔ Published release 1.0.0-next.2 on next channel

То, что я пробовал :

Добавление этих опций и локальный запуск.

`ci: false`

`dryRun: true`

Запуск npx semantic-release локально на моем компьютере, когда ветка бета-версии проверена после фиксации, которая увеличивает версию. По-прежнему та же проблема, журналы отладки сообщают, например, о значительном увеличении версии, но все равно остаются в том же 1.0.0-next.x, в этом случае должно быть 2.0.0-next.x.

Если кто-то может помочь это будет с благодарностью:)

1 Ответ

0 голосов
/ 04 апреля 2020

Я сталкивался с тем же поведением и приступил к изучению источника semantic-release.

На версии 17.0.3 semantic-release переключился на использование примечаний Git для хранения информации о том, какие выпуски происходили в каких филиал. Однако сила pu sh перезапишет Git заметки. Вручную добавление заметок вернулось мне.

У них есть инструкции по добавлению заметок при устранении неполадок: c здесь:

https://github.com/semantic-release/semantic-release/blob/master/docs/support/troubleshooting.md#release -not-found-release- ветвей после- git -Pu sh --- сила

...