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

ci: auto npm publish script #757

Closed
wants to merge 4 commits into from
Closed

ci: auto npm publish script #757

wants to merge 4 commits into from

Conversation

import-brain
Copy link
Member

fixes #268

@import-brain import-brain added c: chore PR that doesn't affect the runtime behavior p: 1-normal Nothing urgent labels Apr 2, 2022
@import-brain import-brain requested a review from a team April 2, 2022 13:37
@import-brain import-brain self-assigned this Apr 2, 2022
@import-brain import-brain requested a review from a team as a code owner April 2, 2022 13:37
@codecov
Copy link

codecov bot commented Apr 2, 2022

Codecov Report

Merging #757 (b4c47e2) into main (462ee5a) will increase coverage by 0.00%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #757   +/-   ##
=======================================
  Coverage   99.62%   99.62%           
=======================================
  Files        2156     2156           
  Lines      237025   237025           
  Branches     1006     1008    +2     
=======================================
+ Hits       236126   236136   +10     
+ Misses        878      868   -10     
  Partials       21       21           
Impacted Files Coverage Δ
src/modules/internet/user-agent.ts 84.39% <0.00%> (+2.64%) ⬆️

@Shinigami92
Copy link
Member

Shinigami92 commented Apr 2, 2022

This looks ridiculously easy 🤔 sus?

ST-DDT
ST-DDT previously approved these changes Apr 2, 2022
Copy link
Member

@ST-DDT ST-DDT left a comment

Choose a reason for hiding this comment

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

I cannot test this, but I think it looks good.
We can merge and check it Monday with our v6.1.2 release.

@ST-DDT ST-DDT requested a review from a team April 2, 2022 13:49
Shinigami92
Shinigami92 previously approved these changes Apr 2, 2022
Copy link
Member

@Shinigami92 Shinigami92 left a comment

Choose a reason for hiding this comment

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

But we need @prisis or @damienwebdev to add the token

@import-brain
Copy link
Member Author

This looks ridiculously easy 🤔 sus?

May or may not have been copy-pasted from GitHub documentation😂

@xDivisionByZerox
Copy link
Member

xDivisionByZerox commented Apr 2, 2022

Isn't the point of this pipeline to ensure that things like v6.1.0 don't happen again? Well, the pipeline doesn't build the newest state of the library. In fact, it doesn't build the project at all. Or did I miss something? Does the npm publish automatically include a build?

@Shinigami92
Copy link
Member

Shinigami92 commented Apr 2, 2022

Does the npm publish automatically include a build?

Yes it does, since 6.1.1

62dcfc9#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R76

But this PR would not change something for that, cause it now would do it for manually publishes too

@xDivisionByZerox
Copy link
Member

Ok, I didn't notice that. But tbh I'm not a fan of relying on pre/post scripts for pipelines since:

  1. I want to see what a pipeline does by looking at its config file
  2. A change in this script can slip in too easy without noticing it directly

Just some points you might want to consider.

@ST-DDT
Copy link
Member

ST-DDT commented Apr 2, 2022

@xDivisionByZerox So you would like us to explicitly call build or what?

@xDivisionByZerox
Copy link
Member

xDivisionByZerox commented Apr 2, 2022

@xDivisionByZerox So you would like us to explicitly call build or what?

I would do so for my pipelines, yes. But I don't think I'm in the position to demand anything.

I guess it would be helpful enough, for anyone that might have a look at the config in the future, to add a comment over the npm publish, that there is a pre-publish script in place.

.github/workflows/npm-publish.yml Outdated Show resolved Hide resolved
.github/workflows/npm-publish.yml Outdated Show resolved Hide resolved
.github/workflows/npm-publish.yml Show resolved Hide resolved
@pkuczynski
Copy link
Member

I am with @xDivisionByZerox on this...

@ST-DDT
Copy link
Member

ST-DDT commented Apr 2, 2022

I am with @xDivisionByZerox on this...

Would something like this suffice for you?

# Relies on the prepublishOnly hook to build the project
- run: npm publish

Unfortunately it isn't possible to add comments to the package.json to add a hint there too.
IMO the info in the pipeline is not really helpful, because it only state what it depends on (and that it's nothing extraordinary for an Node dev), but the other side contains no reference to dependent steps (and AFAICT these vary greatly between projects).

@xDivisionByZerox
Copy link
Member

Would something like this suffice for you?

# Relies on the prepublishOnly hook to build the project
- run: npm publish

Unfortunately it isn't possible to add comments to the package.json to add a hint there too. IMO the info in the pipeline is not really helpful, because it only state what it depends on (and that it's nothing extraordinary for an Node dev), but the other side contains no reference to dependent steps (and AFAICT these vary greatly between projects).

I mean if you state it that way, why not explicitly call the necessary build steps? Yes, it's a bit redundant and takes some more time to complete, on the other side this is run like once a week, so it shouldn't matter.
Even going a step further: Why not remove the prepublish script from the package? When a release pipeline is in place NOONE should make a manual release EVER.

@prisis
Copy link
Member

prisis commented Apr 3, 2022

I would go more in this direction https://www.npmjs.com/package/@changesets/cli, check https://github.com/Thinkmill/manypkg as example how it works, it creates a .changeset folder with all the changes than can be than released

In the end we need to discuss how the workflow should be, and what we want :)

@ST-DDT
Copy link
Member

ST-DDT commented Apr 3, 2022

Looks like we won't have a pipeline by Monday.

@prisis
Copy link
Member

prisis commented Apr 3, 2022

Nope, sorry... , we can talk about it tomorrow in the call :)

@import-brain import-brain added the s: needs decision Needs team/maintainer decision label Apr 3, 2022
@xDivisionByZerox xDivisionByZerox added the c: infra Changes to our infrastructure or project setup label Jul 28, 2022
.github/workflows/npm-publish.yml Outdated Show resolved Hide resolved
.github/workflows/npm-publish.yml Outdated Show resolved Hide resolved
@import-brain import-brain dismissed stale reviews from Shinigami92 and ST-DDT via 77d0346 August 13, 2022 04:55
import-brain and others added 2 commits August 13, 2022 00:55
Co-authored-by: Shinigami <chrissi92@hotmail.de>
Co-authored-by: pkuczynski <piotr.kuczynski@gmail.com>
Co-authored-by: Shinigami92 <chrissi92@hotmail.de>
- uses: actions/setup-node@v3
with:
node-version: 18
- run: pnpm ci
Copy link
Member

Choose a reason for hiding this comment

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

Does this command exist only in ci? I cannot run it locally.

Copy link
Member

Choose a reason for hiding this comment

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

I think this is the native npm not pnpm command
The theoretically equivalent would be something like using --frozen-lockfile
But this might be auto-enables in env CI=true
https://pnpm.io/cli/install#--frozen-lockfile

@ST-DDT ST-DDT added s: on hold Blocked by something or frozen to avoid conflicts and removed s: needs decision Needs team/maintainer decision labels Jan 26, 2023
@import-brain
Copy link
Member Author

Superseded by #1096

@ST-DDT
Copy link
Member

ST-DDT commented Jan 30, 2023

@import-brain Do you still need the branch? If not, please delete it.

@import-brain import-brain deleted the npm_publish branch January 30, 2023 00:39
@import-brain
Copy link
Member Author

@import-brain Do you still need the branch? If not, please delete it.

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: chore PR that doesn't affect the runtime behavior c: infra Changes to our infrastructure or project setup p: 1-normal Nothing urgent s: on hold Blocked by something or frozen to avoid conflicts
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Automatic npm publish on commit
6 participants