private doRelease()

in src/targets/go.ts [183:221]


  private doRelease(modules: GoModule[], repoDir: string): GoRelease {

    git.identify(this.gitUsername, this.gitUseremail);
    git.checkout(this.gitBranch, { createIfMissing: true });
    this.syncRepo(repoDir);

    git.add('.');
    if (!git.diffIndex()) {
      console.log('No changes. Skipping release');
      return {};
    }

    const commitMessage = this.gitCommitMessage ?? this.buildReleaseMessage(modules);
    git.commit(commitMessage);

    const tags = [];
    for (const module of modules) {
      const name = this.buildTagName(module);
      const created = git.tag(name);
      if (created) { tags.push(name); }
    }

    if (tags.length === 0) {
      console.log('All tags already exist. Skipping release');
      return {};
    }

    const refs = [...tags, this.gitBranch];

    if (this.dryRun) {
      console.log('===========================================');
      console.log('            🏜️ DRY-RUN MODE 🏜️');
      console.log('===========================================');
      refs.forEach(t => console.log(`Remote ref will be updated: ${t}`));
    } else {
      refs.forEach(t => git.push(t));
    }
    return { tags, commitMessage, repoDir };
  }