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

DE-6746: Add a GH workflow to publish a release #18

Merged
merged 11 commits into from
Nov 29, 2023

Conversation

fingerartur
Copy link
Contributor

@fingerartur fingerartur commented Nov 21, 2023

Here I'm adding a GitHub workflow to publish a new version to NPM and deploy API docs for that version to https://players.castlabs.com/react-dom/x.x.x/docs/. It gets triggered when we create a new Release in GitHub (when creating the release, select "Create new tag" and specify the target version).

Beta versions are also supported and they will be published accordingly to a NPM beta channel (non-main channel).

@fingerartur fingerartur force-pushed the feat/DE-6746-workflow branch 2 times, most recently from 002c1bb to 8ef14d1 Compare November 28, 2023 08:31
@fingerartur fingerartur changed the title DE-6746: Add a GH action to publish a release DE-6746: Add a GH workflow to publish a release Nov 28, 2023
@fingerartur fingerartur marked this pull request as ready for review November 28, 2023 08:36
@fingerartur fingerartur force-pushed the feat/DE-6746-workflow branch from 73e6cc7 to 2dd49bf Compare November 28, 2023 09:19
Add a GitHub workflow which publishes the package to NPM
and API docs to `https://players.castlabs.com/react-dom/<version>/docs/`
when a new Release is manually created on GitHub.
The version is taken from the tag created with the Release on GitHub.

Beta versions are also supported.

Also clean up the readme and the docs homepage.
@fingerartur fingerartur force-pushed the feat/DE-6746-workflow branch from 2dd49bf to f575c8f Compare November 28, 2023 09:35
@fingerartur fingerartur requested a review from thasso November 28, 2023 09:37
Copy link
Contributor

@thasso thasso left a comment

Choose a reason for hiding this comment

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

I had some minor comments but i think we need to carefully double check our usage of the NPM token. I would like to have it as part of an environment that is linked to a protected branch. Not sure if we can do this with the current structure though.

.github/actions/publish/main.js Outdated Show resolved Hide resolved
.github/actions/publish/main.js Outdated Show resolved Hide resolved
.github/workflows/publish.yml Outdated Show resolved Hide resolved
story/stories/examples/DefaultSkinSource.tsx Outdated Show resolved Hide resolved
story/stories/examples/YoutubeSkinSource.ts Outdated Show resolved Hide resolved
@fingerartur fingerartur requested a review from thasso November 28, 2023 18:19
@fingerartur
Copy link
Contributor Author

fingerartur commented Nov 28, 2023

@thasso I've also added provenance verification and switched to a granular NPM token.

Provenance works, I've tested it with a beta NPM release, just an interesting note on that topic: it needs Node.js version 20 (actually version 18 would be enough, but GitHub actions somehow don't support it, at least not explicitly, so version 20 it is 😄).

Copy link
Contributor

@thasso thasso left a comment

Choose a reason for hiding this comment

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

nice, just one more suggestion on how we expose the token that you might want to give a shot.

.github/actions/publish/main.js Outdated Show resolved Hide resolved
@fingerartur fingerartur requested a review from thasso November 29, 2023 05:38
@fingerartur fingerartur merged commit 1d4d7c4 into main Nov 29, 2023
1 check passed
@fingerartur fingerartur deleted the feat/DE-6746-workflow branch December 12, 2023 16:09
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.

2 participants