@@ -79,42 +79,46 @@ semantic-release can be triggered locally by following these steps:
7979> next step.
8080
8181``` bash
82- # These command must be run from the project root
82+ # These command must be run from the project root. It is recommended to clone a
83+ # fresh version of the repo to a temp directory and run these commands from
84+ # there.
8385
84- # 1. Setup the local environment. Add your auth tokens to this file
85- # ! DO NOT COMMIT THIS FILE !
86+ # 1. Install dependencies and add your auth tokens to the .env file.
87+ # ! DO NOT COMMIT THE .env FILE !
8688cp .env.default .env
89+ npm ci
8790
88- # 2. Reset the working directory to a clean state (deletes all ignored files)
91+ # 2. Reset the working directory to a clean state (deletes all ignored files).
8992npm run clean
9093
91- # 3. Lint all files
94+ # 3. Lint all files.
9295npm run lint:all
9396
94- # 4. Build distributables
97+ # 4. Build distributables.
9598npm run build:dist
9699
97- # 5. Build auxiliary documentation
100+ # 5. Build auxiliary documentation.
98101npm run build:docs
99102
100- # 6. Build any external executables (used in GitHub Actions workflows)
103+ # 6. Build any external executables (used in GitHub Actions workflows).
101104npm run build:externals
102105
103- # 7. Format all files
106+ # 7. Format all files.
104107npm run format
105108
106- # 8. Run all possible tests and generate coverage information
109+ # 8. Run all possible tests and generate coverage information.
107110npm run test:all
108111
109- # 9. Upload coverage information to codecov (only if you have the proper token)
112+ # 9. Upload coverage information to codecov (only if you have the proper token).
110113CODECOV_TOKEN=$( npx --yes dotenv-cli -p CODECOV_TOKEN) codecov
111114
112115# 10. Trigger semantic-release locally and generate a new release. This requires
113- # having tokens for NPM and GitHub with the appropriate permissions. This
114- # command should be run in a clean environment using a user account without a
115- # home directory (so no ~/.npmrc or ~/.gnupg directories). On linux, you can use
116- # the "nobody" user (if they have a writable homedir) like below:
117- sudo -u nobody NPM_TOKEN=$( npx --yes dotenv-cli -p NPM_TOKEN) GH_TOKEN=$( npx --yes dotenv-cli -p GITHUB_TOKEN) HUSKY=0 UPDATE_CHANGELOG=true GIT_AUTHOR_NAME=$( git config --global --get user.name) GIT_COMMITTER_NAME=$( git config --global --get user.name) GIT_AUTHOR_EMAIL=$( git config --global --get user.email) GIT_COMMITTER_EMAIL=$( git config --global --get user.email) npx --no-install semantic-release --no-ci --extends " $( pwd) /release.config.js"
116+ # having tokens for NPM and GitHub with the appropriate permissions.
117+ #
118+ # Do a dry run first:
119+ env -i NPM_TOKEN=" $( npx --yes dotenv-cli -p NPM_TOKEN) " GH_TOKEN=" $( npx --yes dotenv-cli -p GITHUB_TOKEN) " HUSKY=0 UPDATE_CHANGELOG=true GIT_AUTHOR_NAME=" $( npx --yes dotenv-cli -p GIT_AUTHOR_NAME) " GIT_COMMITTER_NAME=" $( npx --yes dotenv-cli -p GIT_COMMITTER_NAME) " GIT_AUTHOR_EMAIL=" $( npx --yes dotenv-cli -p GIT_AUTHOR_EMAIL) " GIT_COMMITTER_EMAIL=" $( npx --yes dotenv-cli -p GIT_COMMITTER_EMAIL) " node node_modules/.bin/semantic-release --no-ci --extends " $( pwd) /release.config.js" --dry-run
120+ # Then do the actual publish:
121+ env -i NPM_TOKEN=" $( npx --yes dotenv-cli -p NPM_TOKEN) " GH_TOKEN=" $( npx --yes dotenv-cli -p GITHUB_TOKEN) " HUSKY=0 UPDATE_CHANGELOG=true GIT_AUTHOR_NAME=" $( npx --yes dotenv-cli -p GIT_AUTHOR_NAME) " GIT_COMMITTER_NAME=" $( npx --yes dotenv-cli -p GIT_COMMITTER_NAME) " GIT_AUTHOR_EMAIL=" $( npx --yes dotenv-cli -p GIT_AUTHOR_EMAIL) " GIT_COMMITTER_EMAIL=" $( npx --yes dotenv-cli -p GIT_COMMITTER_EMAIL) " node node_modules/.bin/semantic-release --no-ci --extends " $( pwd) /release.config.js"
118122```
119123
120124<!-- lint ignore -->
0 commit comments