Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need help to reset semantic-release tag/note info after channel was hosed #3536

Closed
RupertBarrow opened this issue Dec 9, 2024 · 1 comment

Comments

@RupertBarrow
Copy link

RupertBarrow commented Dec 9, 2024

Current behavior

On "development" channel, I had successfully created version up to "1.0.0-development.178".
Something hosed this, and new releases are creating versions starting back at "1.0.0-development.1" (2, 3 etc.)

Expected behavior

Should still be creating new versions above "1.0.0-development.178"

semantic-release version

24.1.1

CI environment

GitHub Actions

Plugins used

    "@semantic-release/github",
    "@semantic-release/exec" 
      "@semantic-release/commit-analyzer"
    "@semantic-release/release-notes-generator"
"@semantic-release/changelog"
      "@semantic-release/git"
"@semantic-release/exec"

semantic-release configuration

/**
 * @type {import('semantic-release').GlobalConfig}
 */

/**
 * INPUTS :
 * - Relies on the following environment variables, defined in release.yml, to publish to Capgo :
 *    . CAPGO_APIKEY
 *    . APPID
 *
 * OUTPUTS :
 * - The released version is written to a file named VERSION, for use in the Github Action workflow
 */

export default {
  branches: [
    // Production
    {
      name: "(release|release-*)",
      channel: "release",
    },

    // Pre-release branches
    {
      name: "(alpha|alpha-*)",
      channel: "alpha",
      prerelease: true,
    },
    {
      name: "(beta|beta-*)",
      channel: "beta",
      prerelease: true,
    },

    // Developer branches all update the 'development' channel and prerelease
    {
      name: "main",
      channel: "development",
      prerelease: "development",
    },
    {
      name: "(dev-*)",
      channel: "development",
      prerelease: true,
    },
  ],
  ci: true,
  debug: true,
  dryRun: false,
  repositoryUrl: "https://github.com/RupertBarrow/colleurs-app",

  // prettier-ignore
  verifyConditions: [
    "@semantic-release/github",
    "@semantic-release/exec"      // verify CapGo login
  ],

  // prettier-ignore
  plugins: [
    [
      "@semantic-release/commit-analyzer", {
        preset: "angular",
        releaseRules: [
          { type: "breaking", release: "major" },
          { type: "feat", release: "minor" },
          { type: "fix", release: "patch" },
          { type: "ci", release: "patch" },
          { type: "doc", release: "patch" },
          { type: "docs", release: "patch" },
          { type: "refactor", scope: "core-*", release: "minor" },
          { type: "refactor", release: "patch" },

          { scope: "no-release", release: false },
        ],
      },
    ],

    "@semantic-release/release-notes-generator",

    ["@semantic-release/changelog", { changelogFile: "CHANGELOG.md" }],

    // Commit these files to Git(hub) after they have been updated by semantic-release
    [
      "@semantic-release/git", {
        assets: ["package.json", "CHANGELOG.md", "ios/App/App.xcodeproj/project.pbxproj"],
        message: "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
      },
    ],

    // Add the CHANGELOG.md file as an attachment to the Github release
    ["@semantic-release/github", { assets: ["CHANGELOG.md"] }],

    // Deploy to CagGo : this deploys JS updates only
    // NB: XCode Cloud builds binary releases published to the App Store, triggered by the update of the CHANGELOG.md,
    // on the pre-release 'alpha*' or 'beta*' branches
    [
      "@semantic-release/exec", {
        verifyConditionsCmd: "npx @capgo/cli login $CAPGO_APIKEY && npx @capgo/cli app set $APPID",
        prepareCmd: "npm run build:${branch.channel}",
        publishCmd: "npm add -D @capgo/cli && npx @capgo/cli bundle upload --channel ${branch.channel} --apikey $CAPGO_APIKEY --bundle ${nextRelease.version} --bundle-url $APPID",

        // Publish the released version on the Github Action workflow output
        successCmd: "echo v${nextRelease.version} > VERSION"
      },
    ],

  ],
};

CI logs

...
[9:32:57 PM] [semantic-release] › ✔  Completed step "prepare" of plugin "@semantic-release/exec"
[9:32:59 PM] [semantic-release] › ✔  Created tag v1.0.0-development.6
[9:32:59 PM] [semantic-release] › ℹ  Start step "publish" of plugin "@semantic-release/github"
[9:33:00 PM] [semantic-release] [@semantic-release/github] › ℹ  Published file https://github.com/RupertBarrow/colleurs-app/releases/download/untagged-4081ec55d79a55cce2eb/CHANGELOG.md
[9:33:01 PM] [semantic-release] [@semantic-release/github] › ℹ  Published GitHub release: https://github.com/RupertBarrow/colleurs-app/releases/tag/v1.0.0-development.6
[9:33:01 PM] [semantic-release] › ✔  Completed step "publish" of plugin "@semantic-release/github"
[9:33:01 PM] [semantic-release] › ℹ  Start step "publish" of plugin "@semantic-release/exec"
[9:33:01 PM] [semantic-release] [@semantic-release/exec] › ℹ  Call script npm add -D @capgo/cli && npx @capgo/cli bundle upload --channel development --apikey $CAPGO_APIKEY --bundle 1.0.0-development.6 --bundle-url $APPID

[Capgo] ■  Version already exists 
...
@RupertBarrow
Copy link
Author

I need to force the next semantic-release version number to "v1.0.0-development.179" by fixing the git tags and related git notes. What procedure do you suggest ?

@semantic-release semantic-release locked and limited conversation to collaborators Dec 10, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant