@@ -79,42 +79,46 @@ semantic-release can be triggered locally by following these steps:
79
79
> next step.
80
80
81
81
``` 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.
83
85
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 !
86
88
cp .env.default .env
89
+ npm ci
87
90
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).
89
92
npm run clean
90
93
91
- # 3. Lint all files
94
+ # 3. Lint all files.
92
95
npm run lint:all
93
96
94
- # 4. Build distributables
97
+ # 4. Build distributables.
95
98
npm run build:dist
96
99
97
- # 5. Build auxiliary documentation
100
+ # 5. Build auxiliary documentation.
98
101
npm run build:docs
99
102
100
- # 6. Build any external executables (used in GitHub Actions workflows)
103
+ # 6. Build any external executables (used in GitHub Actions workflows).
101
104
npm run build:externals
102
105
103
- # 7. Format all files
106
+ # 7. Format all files.
104
107
npm run format
105
108
106
- # 8. Run all possible tests and generate coverage information
109
+ # 8. Run all possible tests and generate coverage information.
107
110
npm run test:all
108
111
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).
110
113
CODECOV_TOKEN=$( npx --yes dotenv-cli -p CODECOV_TOKEN) codecov
111
114
112
115
# 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"
118
122
```
119
123
120
124
<!-- lint ignore -->
0 commit comments