Skip to content

Commit

Permalink
chore: add ci step to verify changelogs available
Browse files Browse the repository at this point in the history
  • Loading branch information
arunvishnun committed Mar 27, 2023
1 parent c21424d commit 203ca6d
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 19 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ name: Node.js CI

on:
push:
branches: [ "master", "next-webpack-5", "rush-pnpm-migration" ]
branches: [ "master" ]
pull_request:
branches: [ "master", "next-webpack-5", "rush-pnpm-migration" ]
branches: [ "master" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -30,8 +30,17 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- run: node common/scripts/install-run-rush.js install
- run: node common/scripts/install-run-rush.js rebuild --verbose
- run: node common/scripts/install-run-rush.js test --verbose
# - run: node common/scripts/install-run-rush.js change -v
# TODO: enable `rush change -v` after rush migration is completed.
- name: Verify Change Logs
# run: node common/scripts/install-run-rush.js change --verify --target-branch upstream/master

- name: Install
run: node common/scripts/install-run-rush.js install

- name: Build
run: node common/scripts/install-run-rush.js rebuild --verbose

- name: Test
run: node common/scripts/install-run-rush.js test --verbose


51 changes: 38 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,23 +128,48 @@ $ pnpm run deploy
- Run `rush change --target-branch <targetBranchWhichIsUsualyMaster>`
- This generates *change files*
- Commit *change files*
- Push the PR and get it reviewd and merged
- Push the PR, get it reviewd and merged.


### Publish flow
When its time to publish packages (as per release schedule)
- Pull latest from `master` branch
- Run `rush publish —apply`
- This is [dry run mode].
- Changes are added to the changelog files for each package.
- The `package.json` files are updated with new version numbers and written to disk. Nothing is actually committed to the source repository or published at this point
- Review the CHANGELOG.md updates at this point
- Run `rush publish --apply --target-branch main --publish --add-commit-details`
- This will create a branch with `publish-*`
- Publish the packages
- And finally checkout back to *target branch* (`master` in this case)
- Checkout to publish branch that got created above

#### **Pre-requisites for publishing**

- Make sure you have account created at https://www.npmjs.com/ and setup 2FA
- Get access to all packages which you need to publish, you can verify it from here: https://www.npmjs.com/settings/{npm-userid}/packages
- Make sure you have below lines in .npmrc file

```bash
registry=https://registry.npmjs.com/
strict-ssl=false
//registry.npmjs.com/:_authToken={token will be generated}
```

- Use below command to login to npm from commandline
- `npm login`

#### **Publishing**

Publishing is a three step process. When its time to publish packages (as per release schedule), make sure above pre-requisites are followed and the latest is pulled from `master` branch
#### **Increase the package versions**
- Run `rush version --bump`
- This is [dry run mode].
- Changes are added to the changelog files for each package.
- The `package.json` files are updated with new version numbers and written to disk. Nothing is actually committed to the source repository or published at this point
- Review the CHANGELOG.md updates at this point

#### **Publish Packages**
- Run `rush publish --include-all --publish`
- This will publish all the public packages that have version increased.
- Push the changes as PR to get the `CHANGELOG.md` updated to `master`.

#### **Create Tag**
- Add release tag, where <#> is the major archetype version, and <date> as YYYYMMDD (ie: rel-v11-20230327)
- `git tag -a rel-v<#>-date`
- Push the tag created
- `git push origin rel-v<#>-date`


Read more about [rush publishing] and [best practices]


Expand Down

0 comments on commit 203ca6d

Please sign in to comment.