Skip to content
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

Add automated release workflows #853

Merged
merged 1 commit into from
Oct 7, 2021
Merged

Conversation

RobinMalfait
Copy link
Member

@RobinMalfait RobinMalfait commented Oct 7, 2021

Whenever we push a commit to the develop branch, a new version should be released to npm using the dev tag.
Whenever we push a commit to the main branch, a new version should be released to npm using the next tag.

This allows me to post the following message on every PR/issue that has been merged/fixed.

This should be fixed, and will be available in the next release.

You can already try it using:
- `npm install @headlessui/react@dev` or `yarn add @headlessui/react@dev`.
- `npm install @headlessui/vue@dev` or `yarn add @headlessui/vue@dev`.

I used this message before, but then I manually published those version to npm.


This might take multiple tries...

@RobinMalfait RobinMalfait changed the title add release workflows Add release workflows Oct 7, 2021
@vercel
Copy link

vercel bot commented Oct 7, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

headlessui-react – ./packages/@headlessui-react

🔍 Inspect: https://vercel.com/tailwindlabs/headlessui-react/32EAqT8Ei6YNZ9eRrBMRDBmnqHvb
✅ Preview: https://headlessui-react-git-add-automated-releases-tailwindlabs.vercel.app

headlessui-vue – ./packages/@headlessui-vue

🔍 Inspect: https://vercel.com/tailwindlabs/headlessui-vue/4XREMo3wayQWD4S1i2WwmNCFHFKZ
✅ Preview: In Progress

@RobinMalfait RobinMalfait changed the title Add release workflows Add automated release workflows Oct 7, 2021
@RobinMalfait RobinMalfait merged commit fd76be7 into develop Oct 7, 2021
@RobinMalfait RobinMalfait deleted the add-automated-releases branch October 7, 2021 14:20
RobinMalfait added a commit that referenced this pull request Oct 8, 2021
RobinMalfait added a commit that referenced this pull request Oct 8, 2021
This commit also contains new code introduced after the PR in #853 was
merged. I just squashed it all together to prevent noisy commits to try
and fix CI.

The funny thing is that now the final commit looks fairly stupid/simple
but it wasn't that easy as I would have liked.

1. Couldn't find a proper way to execute `npm version` using yarn
   workspaces. `yarn workspaces foreach npm version` would have worked
   if we were using Yarn 2 instead of Yarn 1.
2. Introducing `version` and `publish` scripts in both packages worked,
   but then the default `version` and `publish` were also executed.
3. Once I made the scripts unique (`npm-version`,  `npm-publish`) it
   worked~ish. The registry was always set to a yarnpkg registry, even
   if we set the registry in CI and in a local .npmrc file. My guess is
   that we are executing in a nested directory and therefore it didn't
   work.
4. Next, I found the `npm workspaces` option so that we can use that in
   addition to `yarn workspaces` 🙃
5. In CI of course this didn't work, because I was not using the same
   node version...
6. After everything worked, I did cleanup of the new scripts, and
   removed the introduced .npmrc files.
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.

1 participant