Skip to content

Commit

Permalink
Fix release packaging (#14)
Browse files Browse the repository at this point in the history
* Use pnpm workspaces and `9.4.0`

* Fix changesets release, publish, tag

* Temporarily add PR branch to test release process

* Remove eager prerelease config

* Remove version constraint (should use `package.json` value)

* Remove builds from PR branch

* Create CONTRIBUTING.md

* Ensure `.changeset` is at the root

* Remove package-level `release`

* Remove all `workflow`-specific commands in release

* Remove PR branch from release workflow
  • Loading branch information
jpwilliams authored Sep 26, 2024
1 parent cfc39a4 commit f7e0386
Show file tree
Hide file tree
Showing 8 changed files with 5,330 additions and 5,503 deletions.
File renamed without changes.
File renamed without changes.
17 changes: 5 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ name: Release

on:
push:
# branches:
# - main
tags:
- 'v*'
branches:
- main

env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Expand All @@ -30,19 +29,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.4.0
- run: pnpm install
working-directory: packages/workflow
- run: pnpm run build
working-directory: packages/workflow
- run: pnpm run test
working-directory: packages/workflow
- uses: changesets/action@v1
with:
cwd: packages/workflow
title: 'Release @latest'
publish: pnpm publish --access public --provenance --no-git-checks
title: "Release @latest"
publish: pnpm run release
env:
GITHUB_TOKEN: ${{ secrets.CHANGESET_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
42 changes: 42 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Contributing

## Releasing

To release to production, we use
[Changesets](https://github.com/changesets/changesets). This means that
releasing and changelog generation is all managed through PRs, where a bot will
guide you through the process of adding release notes to PRs.

When you create a PR, the <kbd>changeset-bot</kbd> will add a comment prompting you
to add changesets if this PR requires it.

![image](https://github.com/user-attachments/assets/91a980f0-d4af-4bad-bb29-732e2be5ff87)

Clicking the bottom link will take you to the creation of a new changeset on GitHub. It'll look something like this:

```
---
"@inngest/workflow-kit": patch
---
An important change
```

Here we're stating that this PR will change the patch version with the release note `An important change`.

Each changeset you create will constitute a single user-facing note in
the changelog and GitHub Release notes, so think about how best to introduce a
user to a new feature, fix, or migration when adding a changeset to a PR.

> [!NOTE]
> Not all changes need a changeset! Since changesets are focused on releases and
> changelogs, changes to a package that don't require these won't need a
> changeset. For example, changing GitHub configuration files or non-user-facing
> markdown.
As PRs are merged into main, a new PR (usually called **Release @latest**) is
created that rolls up all release notes since the last release, allowing you
bundle changes together. Once you're happy with the release, merge this new PR
and the bot will release the package to npm for you and tag the release commit
(which changes version numbers and modifies the changelog) with a tag like
`@inngest/[email protected]`.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"scripts": {
"changeset": "changeset"
"changeset": "changeset",
"test": "pnpm run --if-present --recursive test",
"build": "pnpm run --if-present --recursive build",
"release": "pnpm run build && changeset publish"
},
"dependencies": {
"@changesets/cli": "^2.27.8",
Expand Down
1 change: 1 addition & 0 deletions packages/workflow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Durable visual workflows in your app, instantly",
"main": "dist/index.js",
"scripts": {
"changeset": "changeset",
"build": "rm -rf dist && tsc && cp src/ui/ui.css dist/ui/ui.css",
"test": "jest --logHeapUsage --maxWorkers=8 --coverage --ci --silent=false",
"storybook": "storybook dev -p 6006",
Expand Down
Loading

0 comments on commit f7e0386

Please sign in to comment.