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

chore: workflow dispatch releases #161

Merged
merged 6 commits into from
Jul 31, 2024
Merged

Conversation

Aslemammad
Copy link
Member

No description provided.

Copy link

continuous-releases-staging bot commented Jul 26, 2024

commit: d1b7905

pnpm add https://ba9e6d45.stackblitz-cr.pages.dev/stackblitz-labs/pkg.pr.new/playground-a@161
pnpm add https://ba9e6d45.stackblitz-cr.pages.dev/stackblitz-labs/pkg.pr.new/playground-b@161
pnpm add https://ba9e6d45.stackblitz-cr.pages.dev/stackblitz-labs/pkg.pr.new/pkg-pr-new@161

Open in Stackblitzexample-1example-2

Comment on lines 7 to 17
workflow_dispatch:
inputs:
version:
description: "type of ref"
required: true
type: choice
options:
- patch
- minor
- major
default: "patch"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of doing this with a workflow dispatch, I think it is better to do a scheme like we have in Vite. We have a release script that bumps the version in main and commits that (together with the changelog but not needed here if you don't want) and tags that commit with vX.Y.Z. And then we have an github workflow that publishes each tag that matches that format. See https://github.com/vitejs/vite/blob/main/.github/workflows/publish.yml (we also have another workflow that does a github release on listening to the same event, but that is also not necessary if you don't want). This is a easier flow because you directly release from your CLI with a commit and every published commit is clearly marked in GitHub with a tag.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea I was inspired by vite's workflow, and more importantly, the vite-ecosystem-ci workflow!

To be honest, I think publishing from workflow_dispatches, exactly next to cloudflare deploys would be way better. And then we can create tags (i'll add it in next commits then, I agree).

what do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is better to release from a tag instead like we do in Vite because then you force yourself to only publish properly tagged versions. I think it is useful to have this tagged commit also be the one that is doing the bump. So all is connected.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, you mean just a git push origin tag v0.0.18 would trigger a release?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where would the change of the package.json version would be handled?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I think we can do that but don't we block direct pushes to main?

So we cannot do things with one command alone. Wdyt?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can unblock direct pushes to main if that is an issue. We would still have the approval flow to decide if that push will end up or not published, so it is fine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just pushed a new commit, let me know what you think.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with this if vite releases works for you. It is very opinionated for the packages in the Vite repo, so probably better to use something more common, but let's go with this for now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea it works for our case, not heavily tested though since we need to try all the workflow in the main branch.

@AmirSa12 AmirSa12 merged commit 4fdc18a into main Jul 31, 2024
5 checks passed
@AmirSa12 AmirSa12 deleted the feat/workflow-dispatch-releases branch July 31, 2024 14:08
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.

3 participants