Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 4, 2025

Adds a reusable workflow for releasing Node.js packages with support for multiple registries, optional documentation generation, and integration with CI build artifacts.

Features

  • Registry support: npm, GitHub Packages, or custom registries via URL/JSON config
  • Build artifacts integration: Download and publish artifacts from CI jobs
  • Tarball publishing: Publish pre-built package tarballs with glob pattern support
  • Access control: Package access level configuration (public or restricted)
  • Documentation: Optional docs generation with artifact upload
  • Provenance: npm attestation support (requires npm 9.5.0+)
  • Distribution tags: latest, next, canary, etc.
  • Dry-run mode: Test without publishing
  • Monorepo support: Configurable working directory

Note: Build functionality is handled separately in the continuous-integration.yml workflow.

Usage

Basic Release from Source

jobs:
  release:
    uses: hoverkraft-tech/ci-github-nodejs/.github/workflows/release.yml@main
    permissions:
      contents: read
      packages: write
      id-token: write
    secrets:
      registry-token: ${{ secrets.NPM_TOKEN }}

Release with Build Artifacts from CI

jobs:
  ci:
    uses: ./.github/workflows/__shared-ci.yml
    permissions:
      contents: read
      id-token: write
    secrets: inherit

  release:
    needs: ci
    uses: hoverkraft-tech/ci-github-nodejs/.github/workflows/release.yml@main
    permissions:
      contents: read
      packages: write
      id-token: write
    secrets:
      registry-token: ${{ secrets.NPM_TOKEN }}
    with:
      build-artifact-id: ${{ needs.ci.outputs.build-artifact-id }}
      access: public

Release Pre-built Tarball

jobs:
  release:
    uses: hoverkraft-tech/ci-github-nodejs/.github/workflows/release.yml@main
    permissions:
      contents: read
      packages: write
      id-token: write
    secrets:
      registry-token: ${{ secrets.NPM_TOKEN }}
    with:
      package-tarball: "*.tgz"
      access: public
      provenance: true

Workflow Compatibility

This workflow replaces and consolidates release functionality from existing workflows:

  • ✅ reactionable/reactionable
  • ✅ reactionable/reactionable-cli
  • ✅ escemi-tech/ts-dev-tools
  • ✅ hoverkraft-tech/ci-dokumentor
  • ✅ hoverkraft-tech/docusaurus-theme

Changes

  • .github/workflows/release.yml — reusable workflow
  • .github/workflows/release.md — comprehensive documentation
  • README.md — reference to new workflow
Original prompt

On workflows, Add new reusable-workflow named release.yml that help to release nodejs package
It should support various registry, optionally generate docs


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: neilime <314088+neilime@users.noreply.github.com>
Copilot AI changed the title [WIP] Add new reusable workflow for nodejs package release feat(workflows): add release.yml reusable workflow for Node.js package releases Dec 4, 2025
Copilot AI requested a review from neilime December 4, 2025 19:47
Copy link
Member

@neilime neilime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot handle feedbacks

…flow

Co-authored-by: neilime <314088+neilime@users.noreply.github.com>
Copilot AI requested a review from neilime December 5, 2025 18:17
Copy link
Member

@neilime neilime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot handle feedbacks

@neilime neilime marked this pull request as ready for review December 5, 2025 18:51
…rkflow

Co-authored-by: neilime <314088+neilime@users.noreply.github.com>
Copilot AI requested a review from neilime December 5, 2025 19:05
Copy link
Member

@neilime neilime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

…control

Co-authored-by: neilime <314088+neilime@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 24, 2025

@copilot here are the existing workflows that should be replaced by the ".github/workflows/release.md" we are creating. Ensure that we will support all the scope and behavior:

Analyzed all referenced workflows and added support for their use cases:

Added features:

  • build-artifact-id input to download build artifacts from CI jobs
  • package-tarball input to publish pre-built tarballs (supports glob patterns like *.tgz)
  • access input for package access control (public or restricted)

Supported workflows:

  • ✅ reactionable/reactionable - download build artifacts, publish with custom commands
  • ✅ reactionable/reactionable-cli - tarball publishing, release-please compatible
  • ✅ escemi-tech/ts-dev-tools - Lerna publishing (via custom publish-command), documentation
  • ✅ ci-dokumentor - tarball publishing with provenance, tag-based releases
  • ✅ docusaurus-theme - tarball publishing with provenance

The workflow now supports publishing from source, build artifacts, or pre-built tarballs. Commit 56b60f9.

…ct download path

Co-authored-by: neilime <314088+neilime@users.noreply.github.com>
Copilot AI requested a review from neilime December 24, 2025 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants