-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add docs for the releases workflow #2351
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| # Releasing Packages | ||
|
|
||
| Packages are published to npm via the **Publish NPM** workflow ([`.github/workflows/releases.yml`](../.github/workflows/releases.yml)). The workflow is triggered manually through `workflow_dispatch` from the GitHub Actions UI. | ||
|
|
||
| ## How it works | ||
|
|
||
| The workflow has two jobs: | ||
|
|
||
| 1. **test** — Checks out the specified branch, installs dependencies, bootstraps the monorepo, builds all packages, runs tests, then packs the target package into a `.tgz` archive and uploads it as a workflow artifact. | ||
| 2. **publish** — Downloads the packed artifact and publishes it to npm with `--provenance` (OIDC-based). Sends a Slack notification on success or failure. Requires the `npm-publish` environment. | ||
|
|
||
| ## Inputs | ||
|
|
||
| | Input | Type | Required | Default | Description | | ||
| |---|---|---|---|---| | ||
| | `package` | choice | **yes** | — | Which package to release. One of: `artifact`, `attest`, `cache`, `core`, `exec`, `github`, `glob`, `http-client`, `io`, `tool-cache`. | | ||
| | `branch` | string | no | `main` | The branch to check out and release from. | | ||
| | `npm-tag` | string | no | `latest` | The npm dist-tag to publish under. See [Dist-tags](#dist-tags) below. | | ||
| | `test-all` | boolean | no | `false` | When `false`, only tests for the selected package are run. Set to `true` to run the full test suite across all packages. | | ||
|
|
||
| ## Dist-tags | ||
|
|
||
| npm dist-tags control which version users get when they `npm install @actions/<package>` (or `@<tag>`). | ||
|
|
||
| > **Important:** npm dist-tags **cannot** be valid semver strings. Values like `5.0.0` or `1.2.3` will be rejected by npm. Use a descriptive name instead. | ||
|
|
||
| - **`latest`** — The default tag. This is what users get with a plain `npm install`. Should only be used for releases from `main`. | ||
| - **Custom tags** (e.g. `v1-longlived`) — Used for releases from long-lived or experimental branches. | ||
|
|
||
| Examples of **valid** dist-tags: `latest`, `next`, `beta`, `v1-longlived` | ||
| Examples of **invalid** dist-tags: `5.0.0`, `1.2.3`, `6.0.0-rc.1` (these are semver and will be rejected) | ||
|
|
||
| |  | | ||
| |---| | ||
| | npm distribution tags | | ||
|
|
||
| ### Safety guard | ||
|
|
||
| The workflow **blocks** publishing with the `latest` dist-tag from any branch other than `main`. This prevents accidentally overwriting `latest` with a version from an older or experimental branch. If you're releasing from a non-main branch, use the package's major version as the tag (e.g. `v5`). | ||
|
Link- marked this conversation as resolved.
|
||
|
|
||
| ## Examples | ||
|
|
||
| ### Standard release from main | ||
|
|
||
| Use default inputs — just pick the package: | ||
|
|
||
| | Input | Value | | ||
| |---|---| | ||
| | `package` | `core` | | ||
| | `branch` | `main` (default) | | ||
| | `npm-tag` | `latest` (default) | | ||
| | `test-all` | `false` (default) | | ||
|
|
||
| This publishes the version in `packages/core/package.json` on `main` as `@actions/core@latest`. | ||
|
|
||
| ### Patch release from a long-lived branch | ||
|
|
||
| | Input | Value | | ||
| |---|---| | ||
| | `package` | `artifact` | | ||
| | `branch` | `releases/v5` | | ||
| | `npm-tag` | `v5` | | ||
| | `test-all` | `false` (default) | | ||
|
|
||
| This publishes the version in `packages/artifact/package.json` on the `releases/v5` branch under the `v5` dist-tag. The `latest` tag remains untouched. | ||
|
|
||
| ### Release with full test suite | ||
|
|
||
| | Input | Value | | ||
| |---|---| | ||
| | `package` | `cache` | | ||
| | `branch` | `main` (default) | | ||
| | `npm-tag` | `latest` (default) | | ||
| | `test-all` | `true` | | ||
|
|
||
| Same as a standard release, but runs tests for all packages before publishing. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - You must have permission to trigger workflows on this repository. | ||
| - The `npm-publish` environment must be configured with npm credentials and OIDC. | ||
| - The `SLACK` secret must be set for Slack notifications to work. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.