Skip to content

Commit

Permalink
Merge branch 'main' into override_sha_on_github_action
Browse files Browse the repository at this point in the history
  • Loading branch information
thafryer committed Oct 13, 2023
2 parents 9b16499 + 2261a9f commit 20f94e1
Show file tree
Hide file tree
Showing 39 changed files with 496 additions and 231 deletions.
2 changes: 2 additions & 0 deletions auto.config.ts
Expand Up @@ -6,9 +6,11 @@ import type { AutoRc } from 'auto';
*/
export default function rc(): AutoRc {
return {
baseBranch: 'main',
plugins: ['npm', 'released'],
shipit: {
onlyGraduateWithReleaseLabel: true,
prerelease: true,
},
};
}
2 changes: 1 addition & 1 deletion .github/workflows/chromatic-main-and-prs.yml
Expand Up @@ -10,7 +10,7 @@ jobs:
chromatic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/chromatic-prod.yml
Expand Up @@ -5,7 +5,7 @@ jobs:
chromatic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/chromatic-staging.yml
Expand Up @@ -5,7 +5,7 @@ jobs:
chromatic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
Expand Down
23 changes: 21 additions & 2 deletions .github/workflows/release.yml
@@ -1,13 +1,32 @@
name: Release

on: [push]
on:
# PRs have their own canary releases which always run but don't publish the GitHub Action.
# To allow debugging the release process, this does not have a paths filter.
pull_request:
branches:
- main

# Pushes to main trigger a release and publish the GitHub Action. To allow the occasional update
# to markdown and config files, only changes to actual source code trigger a release.
push:
branches:
- main
paths:
- action-src/**
- bin-src/**
- node-src/**
- action.yml
- isChromatic.*
- package.json
- storybook-addon.*

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke-test-action.yml
Expand Up @@ -5,7 +5,7 @@ jobs:
self-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke-test-node-api.yml
Expand Up @@ -5,7 +5,7 @@ jobs:
self-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke-test-node14.yml
Expand Up @@ -5,7 +5,7 @@ jobs:
self-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke-test-node16.yml
Expand Up @@ -5,7 +5,7 @@ jobs:
self-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke-test-node18.yml
Expand Up @@ -5,7 +5,7 @@ jobs:
self-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke-test-node20.yml
Expand Up @@ -5,7 +5,7 @@ jobs:
self-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke-test-npx.yml
Expand Up @@ -5,7 +5,7 @@ jobs:
chromatic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke-test-windows.yml
Expand Up @@ -5,7 +5,7 @@ jobs:
chromatic:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke-test-yarn-canary.yml
Expand Up @@ -5,7 +5,7 @@ jobs:
chromatic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke-test-yarn-classic.yml
Expand Up @@ -5,7 +5,7 @@ jobs:
chromatic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke-test-yarn.yml
Expand Up @@ -5,7 +5,7 @@ jobs:
self-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
Expand Down
45 changes: 45 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,48 @@
# v7.4.0 (Fri Oct 13 2023)

#### 🚀 Enhancement

- Support untraced flag in dependency tracing fallback scenario (for pnpm) [#835](https://github.com/chromaui/chromatic-cli/pull/835) ([@ghengeveld](https://github.com/ghengeveld))

#### 🐛 Bug Fix

- Improvements to auto release workflow [#832](https://github.com/chromaui/chromatic-cli/pull/832) ([@chromatic-support](https://github.com/chromatic-support) [@ghengeveld](https://github.com/ghengeveld))

#### Authors: 2

- [@chromatic-support](https://github.com/chromatic-support)
- Gert Hengeveld ([@ghengeveld](https://github.com/ghengeveld))

---

# v7.3.0 (Tue Oct 10 2023)

#### 🚀 Enhancement

- Pass runtime metadata in `announceBuild` [#826](https://github.com/chromaui/chromatic-cli/pull/826) ([@ghengeveld](https://github.com/ghengeveld))

#### 🐛 Bug Fix

- Gracefully handle gpg signature info in `git log` output [#833](https://github.com/chromaui/chromatic-cli/pull/833) ([@ghengeveld](https://github.com/ghengeveld))

#### Authors: 1

- Gert Hengeveld ([@ghengeveld](https://github.com/ghengeveld))

---

# v7.2.3 (Fri Oct 06 2023)

#### 🐛 Bug Fix

- Fix dependency tracing for monorepos with no `package.json` at the repository root [#827](https://github.com/chromaui/chromatic-cli/pull/827) ([@ghengeveld](https://github.com/ghengeveld))

#### Authors: 1

- Gert Hengeveld ([@ghengeveld](https://github.com/ghengeveld))

---

# v7.2.2 (Wed Oct 04 2023)

#### ⚠️ Pushed to `main`
Expand Down
78 changes: 17 additions & 61 deletions README.md
Expand Up @@ -17,38 +17,6 @@ Publishes your Storybook to Chromatic and kicks off tests if they're enabled.

📝 View the [Changelog](https://github.com/chromaui/chromatic-cli/blob/main/CHANGELOG.md#readme)

## Using a `next` version

From time to time we pre-publish a `next` version of the package to test new features. To use the
next branch you can either:

### Using `npx`

Change your script to use the `next` dist-tag:

```bash
npx chromatic@next --project-token ...
```

### Using a dependency in `package.json`

Update to the latest `next` version with:

```bash
yarn add --dev chromatic@next

# or
npm i --save-dev chromatic@next
```

### Using the github action

Use our `chromatic-next` action:

```yaml
- uses: chromaui/action-next@v1
```

## Contributing

Contributions of any kind are welcome! We're available to chat via the Intercom widget on the documentation site.
Expand All @@ -58,7 +26,7 @@ Contributions of any kind are welcome! We're available to chat via the Intercom
Compatibility is guaranteed between this package and Chromatic like so:

- Production Chromatic ensures it’s compatible with what’s on npm
- What's on the main branch is equal to what's published on npm
- What's on the Git tag is equal to what's published on npm for that version
- This package ensures it’s compatible with production Chromatic

To facilitate upgrading in the future, removing and adding features, this is the process:
Expand All @@ -76,7 +44,7 @@ To facilitate upgrading in the future, removing and adding features, this is the
#### Running against staging

```bash
CHROMATIC_INDEX_URL=https://index.staging-chromatic.com yarn chromatic -t 253df72b53d2
CHROMATIC_INDEX_URL=https://index.staging-chromatic.com yarn chromatic -t <token>
```

#### Running against development
Expand All @@ -93,41 +61,29 @@ To only test a small number of test stories as a smoke test, use:
SMOKE_TEST=1 CHROMATIC_INDEX_URL=https://index.dev-chromatic.com yarn chromatic -t <token>
```

### Publishing a new version to npm
### Publishing a new version

Before publishing, make sure you've done the following:
We use `auto` to automate the release process. Versions are bumped, tags are created and the changelog is updated automatically. A new release goes out whenever a PR is merged to `main`. A PR **must** have **exactly one** of the following labels before merging:

- Updated CHANGELOG.md
- Committed and pushed everything (clean working directory)
- Decide on the proper semver bump (major/minor/patch)
- Decide on the proper tag (canary/next/latest)
- `major` triggers a major version bump
- `minor` triggers a minor version bump
- `patch` triggers a patch version bump

We have three types of releases:
Additionally, a PR **may** have exactly one of these labels:

- `canary` releases are intended for testing purposes and should not be used in production, as they may only work against a staging or dev environment.
- `next` releases should be valid, working releases that can potentially be used by early adopters of new features, for example to handle a support request.
- `latest` releases are the general audience production releases, used by most people.
- `release` creates a `latest` rather than a `next` release (see below)
- `skip-release` does not create a release at all

> For GitHub Actions, we publish `chromaui/action-canary` and `chromaui/action-next`, which contain the latest `canary` or `next` release, respectively. A `latest` release will also automatically update `chromaui/action-next` (besides `chromaui/action`), in order to keep users who happen to depend on `chromaui/action-next` up to date with the `latest` release.
A script is provided to create new releases:

```sh
yarn release <major|minor|patch> <canary|next|latest> [--dry-run]
```

This script ensures the version is bumped properly, the tag is set correctly and the corresponding GitHub Action is updated.
We have three types of releases:

#### Examples:
- `latest` releases are the general audience production releases, used by most people. Automatically created when merging a PR with the `release` label.
- `next` releases should be valid, working releases that can potentially be used by early adopters of new features, for example to handle a support request. Automatically created when merging a PR without the `release` and `skip-release` labels.
- `canary` releases are intended for testing purposes and should not be used in production, as they may only work against a staging or dev environment. Automatically created on every PR, but does not auto-publush the GitHub Action.

```sh
yarn release patch canary
```
> For GitHub Actions, we publish `chromaui/action-next` and `chromaui/action-canary`. The latter is only published manually, rather than for every PR.
Releases e.g. `6.6.1-canary.0`.
A script is provided to manually publish the GitHub Action, though it's typically only necessary for `action-canary` releases:

```sh
yarn release major latest
yarn publish-action <canary|next|latest>
```

Releases e.g. `7.0.0`.
4 changes: 2 additions & 2 deletions action.yml
Expand Up @@ -64,8 +64,8 @@ inputs:
description: 'Deprecated, use onlyChanged, onlyStoryNames or onlyStoryFiles instead'
required: false
projectToken:
description: 'Your chromatic project token'
required: true
description: 'Your chromatic project token (best provided via env.CHROMATIC_PROJECT_TOKEN)'
required: false
repositorySlug:
description: 'Override the repository slug (e.g. ownerName/repositoryName)'
required: false
Expand Down

0 comments on commit 20f94e1

Please sign in to comment.