Skip to content

Commit 5b2759b

Browse files
committed
ci: update env defaults and related instructions
1 parent 7d07631 commit 5b2759b

File tree

2 files changed

+61
-28
lines changed

2 files changed

+61
-28
lines changed

.env.default

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# Codecov test analysis token
55
#
66
# Required: if deploying
7-
# Matches: ^[a-f0-9-]+$
87
# On-Sync: mirror
98
#
109
# The token used during CI/CD to analyze and upload build artifact code quality
@@ -15,12 +14,52 @@ CODECOV_TOKEN=
1514
#
1615
# Alias: GH_TOKEN
1716
# Required: if deploying
18-
# Matches: ^[a-f0-9]+$
1917
# On-Sync: mirror
2018
#
2119
# The token used during CI/CD to interact with GitHub's API.
2220
GITHUB_TOKEN=
2321

22+
# NPM deploy token
23+
#
24+
# Required: if deploying
25+
# On-Sync: mirror
26+
#
27+
# The token used during CD to login to NPM. Not referenced during non-CI/CD
28+
# (i.e. local, manual) deployments.
29+
NPM_TOKEN=
30+
31+
# Git push author name
32+
#
33+
# Required: if deploying
34+
# On-Sync: mirror
35+
#
36+
# The token used during CD to set the author name of the git push.
37+
GIT_AUTHOR_NAME=
38+
39+
# Git commit committer name
40+
#
41+
# Required: if deploying
42+
# On-Sync: mirror
43+
#
44+
# The token used during CD to set the name attached to any git commits.
45+
GIT_COMMITTER_NAME=
46+
47+
# Git push author email
48+
#
49+
# Required: if deploying
50+
# On-Sync: mirror
51+
#
52+
# The token used during CD to set the author email of the git push.
53+
GIT_AUTHOR_EMAIL=
54+
55+
# Git commit committer email
56+
#
57+
# Required: if deploying
58+
# On-Sync: mirror
59+
#
60+
# The token used during CD to set the email attached to any git commits.
61+
GIT_COMMITTER_EMAIL=
62+
2463
# GPG private key passphrase
2564
#
2665
# Required: if deploying with CI/CD
@@ -38,13 +77,3 @@ GPG_PASSPHRASE=
3877
# The GPG key used to sign all git commits and releases. Not referenced during
3978
# non-CI/CD (i.e. local, manual) deployments.
4079
GPG_PRIVATE_KEY=
41-
42-
# NPM deploy token
43-
#
44-
# Required: if deploying with CI/CD
45-
# Matches: ^[a-f0-9-]+$
46-
# On-Sync: mirror
47-
#
48-
# The token used during CD to login to NPM. Not referenced during non-CI/CD
49-
# (i.e. local, manual) deployments.
50-
NPM_TOKEN=

MAINTAINING.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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 !
8688
cp .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).
8992
npm run clean
9093

91-
# 3. Lint all files
94+
# 3. Lint all files.
9295
npm run lint:all
9396

94-
# 4. Build distributables
97+
# 4. Build distributables.
9598
npm run build:dist
9699

97-
# 5. Build auxiliary documentation
100+
# 5. Build auxiliary documentation.
98101
npm 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).
101104
npm run build:externals
102105

103-
# 7. Format all files
106+
# 7. Format all files.
104107
npm run format
105108

106-
# 8. Run all possible tests and generate coverage information
109+
# 8. Run all possible tests and generate coverage information.
107110
npm 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).
110113
CODECOV_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

Comments
 (0)