Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Changesets

## Adding a release note

Run `npm run changeset` for a releasable change, choose the package and version bump,
and describe the change. Commit the generated `.changeset/*.md` file with your PR.
Include runtime dependency updates that need a release, especially security fixes.
Docs, tests, and development-only tooling changes do not normally need a changeset.

## Preparing and publishing a release

The **Release tracking** workflow opens or updates a PR on pushes to `main` when
changesets are pending. It updates the package version, lockfile, and changelog.
Review and merge that PR, then manually create a GitHub release from its merged
commit, using a tag matching the version in `package.json`.
The existing **Publish** workflow handles publishing. Merging the tracking PR
does not publish packages or create tags or GitHub releases.

For local release preparation, run `npm run version-packages`.
Changes merged before this setup still need a one-time review and changesets for
anything that needs releasing; initialization does not backfill release notes.

## Workflow permissions

Enable **Allow GitHub Actions to create and approve pull requests** in the
repository's Actions settings. The workflow uses `GITHUB_TOKEN` without an npm token.
PRs opened with this token do not automatically trigger other Actions workflows.
If required PR checks depend on those events, use an approved GitHub App token
before enabling the automation.

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets).

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md).
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.3/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- run: npm ci
- run: npx playwright install --with-deps chromium
- run: npm test
- run: npm version ${TAG_NAME} --git-tag-version=false
- run: npm version ${TAG_NAME} --git-tag-version=false --allow-same-version
env:
TAG_NAME: ${{ github.event.release.tag_name }}
- run: npm --ignore-scripts publish --provenance --access public
Expand All @@ -44,7 +44,7 @@ jobs:
- run: npm ci
- run: npx playwright install --with-deps chromium
- run: npm test
- run: npm version ${TAG_NAME} --git-tag-version=false
- run: npm version ${TAG_NAME} --git-tag-version=false --allow-same-version
env:
TAG_NAME: ${{ github.event.release.tag_name }}
- run: npm --ignore-scripts publish --provenance --access public
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/release-tracking.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release tracking

on:
push:
branches: [main]
workflow_dispatch:

concurrency:
group: release-tracking-${{ github.ref }}
cancel-in-progress: false

permissions:
contents: read

jobs:
release-tracking:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: npm
- run: npm ci --ignore-scripts
- name: Create or update release tracking pull request
uses: changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba # v1.5.3 (Changesets CLI v2)
with:
version: npm run version-packages
title: Release tracking
commit: Prepare release
commitMode: github-api
createGithubReleases: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ $ npm test

## Publishing

To publish a new version to npm, [create a GitHub release](https://github.com/github/relative-time-element/releases/new) with the new version tag. If the tag does not exist yet, create it from the release page while creating the release.
Include a [changeset](.changeset/README.md) with each releasable change. Review and merge the automated **Release tracking** pull request when ready to release. It updates `package.json`, `package-lock.json`, and `CHANGELOG.md`, but does not publish anything.

To publish the prepared version to npm, [create a GitHub release](https://github.com/github/relative-time-element/releases/new) from the merged commit, with a tag matching the version in `package.json` (for example, `v5.5.1`). If the tag does not exist yet, create it from the release page while creating the release.

Publishing the release automatically triggers the [Publish workflow](https://github.com/github/relative-time-element/actions/workflows/publish.yml), which tests the package and publishes the tagged version to npm.
Loading