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

Update publish workflow. #554

Merged
merged 2 commits into from
Sep 30, 2024
Merged

Update publish workflow. #554

merged 2 commits into from
Sep 30, 2024

Conversation

hildjj
Copy link
Contributor

@hildjj hildjj commented Sep 24, 2024

Fixes #552

@hildjj hildjj requested a review from Mingun September 24, 2024 15:21
Copy link
Member

@Mingun Mingun left a comment

Choose a reason for hiding this comment

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

The only unclear thing for me is that expected that you will publish also on draft releases, or this situation is impossible? Otherwise relying on your experience

@@ -8,6 +8,7 @@ on:
description: Which branch to deploy to peggyjs.org
required: true
options:
- main
Copy link
Member

Choose a reason for hiding this comment

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

If I correctly understand documentation, this creates a choice widget with two values "main" and "stable" when you run workflow from UI or requires parameter with two possible values when you trigger workflow using some tool? It is unclear for me how that inputs will be provided

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The gh-pages workflow might be deleted after we fully switch over. I want to leave it in place for the short term so that I can easily re-publish just the docs if something goes wrong.

The input is provided when you run the gh-pages workflow manually. The Actions section of the GitHub repository provides a mechanism for running the action and for gathering the input from the person requesting the action be run.

Comment on lines +2 to +4
on:
release:
types: [published]
Copy link
Member

Choose a reason for hiding this comment

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

This will also trigger for draft releases:

A release, pre-release, or draft of a release was published.

Is this what was expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will also trigger for draft releases:

A release, pre-release, or draft of a release was published.

Is this what was expected?

Yes. There are several projects I use that do pre-releases all the way into NPM. npm info eslint versions for an example.

Comment on lines +12 to +15
"repository": {
"type": "git",
"url": "git+https://github.com/peggyjs/peggy.git"
},
Copy link
Member

Choose a reason for hiding this comment

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

This is a new preferred way to specify repositories? What the advantages over the previous format?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Another great question. If you do npm pkg fix it will switch your repository to this format. This format is what is used by the provenance mechanism of npm publish. If you use the simpler format, npm will make this change at publish time and give a warning telling you to run npm pkg fix.

Comment on lines 8 to 10
permissions:
contents: write
id-token: write
Copy link
Member

Choose a reason for hiding this comment

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

Would be good to add comments why this is needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

willfix

@hildjj
Copy link
Contributor Author

hildjj commented Sep 25, 2024

The only unclear thing for me is that expected that you will publish also on draft releases, or this situation is impossible? Otherwise relying on your experience

The type of release is set in two places. One is npm version prerelease --preid=alpha, which creates a version like "4.0.4-alpha.0" if the package is currently at version "4.0.3". That will be fully-supported by this flow.

The second is when you do the release, either with gh release create or in the GitHub site. Either of those have a mechanism to mark the release as "pre-release" and a second choice as to whether this release is "current". This set of choices will also be fully-supported by this flow.

Good question, and I'm glad that we have the workflow handy in case we need it.

@hildjj
Copy link
Contributor Author

hildjj commented Sep 29, 2024

I think I'll also do a 4.1 pre-release to test this out, when I'm ready.

@hildjj
Copy link
Contributor Author

hildjj commented Sep 30, 2024

Seeing no further comments, I'm going to land this. We can revisit as needed if anyone has other insights.

@hildjj hildjj merged commit 4e72c49 into peggyjs:main Sep 30, 2024
10 checks passed
@hildjj hildjj deleted the fix-552 branch September 30, 2024 18:05
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.

Publish from GitHub Actions
2 participants