contributor_docs/release_process.md
MAJOR:MINOR:PATCH.NPM_TOKEN value is set on the remote repositoryACCESS_TOKEN value is set on the remote repositoryFor the release steps to run fully, two repository secrets must be set as below.
NPM_TOKEN can be created by following the steps here 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 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.$ 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.
Once the above commands have been executed, the build and release action can be monitored from the "Actions" tab 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.
Once the job has completed, the library will have been released on GitHub and NPM. Check the release and NPM pages to see that the latest version is released. You should view the draft release on GitHub, make changes to changelog if necessary, then publish the release.
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 if desired, and after that check the "Downloads" page 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.
The GitHub Action "New p5.js release" is triggered on a tag that matches the pattern v*.*.* which is created by the npm version ___ command.
Once triggered, it will run the following steps:
npm, and run test with npm test.data.json and data.min.json to the right locationp5.min.js and p5.sound.min.js to the right locationdata.yml file with latest version numberen.json file based on data.min.jsonIn principle, we try to concentrate as many steps as possible to be run in one place, ie. in the CI environment. If a new step that is only run on release is required, it should probably be defined in the CI workflow and not as part of the build configuration.
As the release steps are run in CI, testing them can be difficult. Using act to test running of the steps locally is possible (and was how they were tested while being developed) but requires some temporary modifications to the workflow definition, we'll roughly document here as the precise steps will likely change over time.
The test steps will not run because not all system requirements are present to run the mocha Chrome tests. Some system dependencies will likely be needed to be installed with apt before setting up the rest of the environment. Keep an eye on the error messages which should give some information on what packages are missing.
The steps concerning pushing changes to remote repositories should be commented out to avoid accidentally pushing unintended changes.