How to use semantic-release - 4 common examples

To help you get started, we’ve selected a few semantic-release examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pmowrer / semantic-release-github-pr / src / index.js View on Github external
// comment and/or posting it when another package has a release (monorepo).
        if (!comments.some(comment => !!parse(comment.body))) {
          createChangelogOnPr(pr);
        }
      });
    }

    // Clean up stale changelog comments, possibly sparing the "no release"
    // comment if this package doesn't have a new release.
    await pullRequests.forEach(
      deleteStaleChangelogs(!nextRelease)(pluginConfig, config)
    );

    return nextRelease;
  },
  pluginDefinitions.analyzeCommits.default
);

const generateNotes = wrapPlugin(
  NAMESPACE,
  'generateNotes',
  plugin => async (pluginConfig, config) => {
    const { pullRequests } = pluginConfig;
    const { nextRelease } = config;

    nextRelease.notes = await plugin(pluginConfig, config);

    await pullRequests.forEach(
      // Create "release" comment
      createChangelog(pluginConfig, { ...config, nextRelease })
    );
github pmowrer / semantic-release-github-pr / src / index.js View on Github external
NAMESPACE,
  'generateNotes',
  plugin => async (pluginConfig, config) => {
    const { pullRequests } = pluginConfig;
    const { nextRelease } = config;

    nextRelease.notes = await plugin(pluginConfig, config);

    await pullRequests.forEach(
      // Create "release" comment
      createChangelog(pluginConfig, { ...config, nextRelease })
    );

    return nextRelease.notes;
  },
  pluginDefinitions.generateNotes.default
);

module.exports = {
  verifyConditions: '@semantic-release/github',
  analyzeCommits: decoratePlugins(analyzeCommits),
  generateNotes: decoratePlugins(generateNotes),
};
github pmowrer / semantic-release-monorepo / src / index.js View on Github external
wrapPlugin,
  wrapMultiPlugin,
} = require('semantic-release-plugin-decorators');

const {
  mapNextReleaseVersion,
  withOptionsTransforms,
} = require('./options-transforms');

const NAMESPACE = 'monorepo';

const analyzeCommits = wrapPlugin(
  NAMESPACE,
  'analyzeCommits',
  compose(logPluginVersion('analyzeCommits'), withOnlyPackageCommits),
  pluginDefinitions.analyzeCommits.default
);

const generateNotes = wrapMultiPlugin(
  NAMESPACE,
  'generateNotes',
  compose(
    logPluginVersion('generateNotes'),
    withOnlyPackageCommits,
    withOptionsTransforms([mapNextReleaseVersion(versionToGitTag)])
  ),
  pluginDefinitions.generateNotes.default
);

module.exports = {
  analyzeCommits,
  generateNotes,
github pmowrer / semantic-release-monorepo / src / index.js View on Github external
const analyzeCommits = wrapPlugin(
  NAMESPACE,
  'analyzeCommits',
  compose(logPluginVersion('analyzeCommits'), withOnlyPackageCommits),
  pluginDefinitions.analyzeCommits.default
);

const generateNotes = wrapMultiPlugin(
  NAMESPACE,
  'generateNotes',
  compose(
    logPluginVersion('generateNotes'),
    withOnlyPackageCommits,
    withOptionsTransforms([mapNextReleaseVersion(versionToGitTag)])
  ),
  pluginDefinitions.generateNotes.default
);

module.exports = {
  analyzeCommits,
  generateNotes,
  tagFormat: readPkg.sync().name + '-v${version}',
};

semantic-release

Automated semver compliant package publishing

MIT
Latest version published 28 days ago

Package Health Score

95 / 100
Full package analysis