Skip to content

Github action for drafting the release #96

Closed

Description

@djsteinmetz
  • Our dotnet SDK uses a github action to draft the release, implement something similar to draft the release so the maintainer only has to open the releases link and publish the release.

Extra: Upon publishing of the release, we could have another action that triggers the publishing to npm, on the publish of the release.

Activity

  1. esitarz commented on Sep 25, 2026

    @esitarz
    Contributor

    Dear @djsteinmetz ,

    This is accepted and now handled by the Tag, Release, & Publish workflow. The remaining gaps in that workflow were closed by #148 .

    The original request was for a GitHub Action, modeled on the .NET SDK, that would draft a GitHub release so a maintainer only had to open the releases page and publish it. The follow-up suggestion was that publishing that release would then publish the package to npm.

    On this repository the same outcome is produced in one workflow, .github/workflows/tag-and-publish.yml, which runs on every push to master. The workflow installs dependencies, builds the SDK, and reads version from package.json. It then takes the matching section from CHANGELOG.md and creates a git tag for that version. When the tag is new, the workflow creates the GitHub release and publishes the package to npm with npm publish --access public. When the tag already exists, the release and npm steps are skipped, so a later push of the same version does not fail the workflow or attempt a second publish.

    #148 is the change that made this path reliable. It points actions/setup-node at https://registry.npmjs.org so the NPM_TOKEN repository secret is actually presented to npm. It writes the changelog section to the Actions step output as a multiline value, so the release step receives the full notes. It also gates both the GitHub release and npm publish on creation of a new tag.

    A maintainer therefore does not assemble the release by hand. Merging a pull request that bumps package.json and adds the corresponding CHANGELOG.md entry is what creates the tag, creates the release, and publishes to npm. Version 13.0.0, merged in #149, is the release that exercised this workflow. The git tag and GitHub release were created by the action, and ordercloud-javascript-sdk@13.0.0 is published on npm.

    The implementation publishes the GitHub release immediately (draft: false) and publishes to npm in that same job. It does not leave a draft for a maintainer to publish, and it does not use a second workflow triggered by the release-published event. That is a stricter form of the automation this issue asked for: merge to master is the publish step.

    Closing as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions