Skip to content

Commit

Permalink
Update release docs
Browse files Browse the repository at this point in the history
  • Loading branch information
limzykenneth committed Jul 12, 2023
1 parent 04dc3c1 commit 7ba96d6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*.DS_STORE
*.DS_Store
.project
node_modules/*
experiments/*
Expand Down
Binary file added contributor_docs/images/release-action.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 16 additions & 5 deletions contributor_docs/release_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,31 @@
* Secret `NPM_TOKEN` value is set on the remote repository
* Secret `ACCESS_TOKEN` value is set on the remote repository

## Security tokens
For the release steps to run fully, two [repository secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) must be set as below.

* `NPM_TOKEN` can be created by following the steps [here](https://docs.npmjs.com/creating-and-viewing-access-tokens) to create a read and publish token. The user the token belongs to must have publish access to the project on NPM.
* `ACCESS_TOKEN` is a personal access token for a user that has access to `p5.js`, `p5.js-website`, and `p5.js-release` repositories. The token can be generated using the steps [here](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) and for scopes, choose only `repo` and `workflow`. It is recommended to use an organization specific account for this (ie. not from a personal account) and limit the account's write access to only the required repositories.

## Usage
```sh
$ git checkout main
$ npm version [major|minor|patch] # Choose the appropriate version tag
$ git push origin main
$ git push origin v1.4.2 # Replace the version number with the one just created above
```
The actual release steps are all run on Github Actions CI. After the action has finished running, you may want to view the release on Github and modify the release note if required (eg. separate all-contributor bot commits with other commits).
The actual release steps are all run on Github Actions CI.

## Security tokens
For the release steps to run fully, two [repository secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) must be set as below.
## Monitor and check results
Once the above commands have been executed, the build and release action can be monitored from the ["Actions" tab](https://github.com/processing/p5.js/actions) on the p5.js GitHub repo page (look for a job that says "New p5.js release"), clicking into the job can give a more detailed job log of what's running.

* `NPM_TOKEN` can be created by following the steps [here](https://docs.npmjs.com/creating-and-viewing-access-tokens) to create a read and publish token. The user the token belongs to must have publish access to the project on NPM.
* `ACCESS_TOKEN` is a personal access token for a user that has access to `p5.js`, `p5.js-website`, and `p5.js-release` repositories. The token can be generated using the steps [here](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) and for scopes, choose only `public_repo`. It is recommended to use an organization specific account for this (ie. not from a personal account) and limit the account's write access to only the required repositories.
[Screenshot of GitHub action running the "New p5.js release" job](images/release-action.png)

Once the job has completed, the library will have been released on GitHub and NPM. Check the [release](https://github.com/processing/p5.js/releases) and [NPM](https://www.npmjs.com/package/p5) pages to see that the latest version is released. The website will be updated as soon as its own build and deploy job is completed, this can also be monitored in the relevant ["Actions" page](https://github.com/processing/p5.js-website/actions) if desired, and after that check the ["Downloads" page](https://p5js.org/download/) on the website for the latest version number.

CDNs will take a bit more time (a day or two) to update but they will automatically pull from NPM upon release so no specific action is required.

---

## What's actually happening
The Github Action ["New p5.js release"](../.github/workflows/release.yml) is triggered on a tag that matches the pattern `v*.*.*` which is created by the `npm version ___` command.
Expand Down

0 comments on commit 7ba96d6

Please sign in to comment.