Skip to content

Commit 012af98

Browse files
authored
feat: US158339 - Add update-package-lock and new release token (#136)
* Add update-package-lock workflow * Update dependabot * Go to node 20 * Switch to new token and update README
1 parent af184bd commit 012af98

File tree

6 files changed

+46
-50
lines changed

6 files changed

+46
-50
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
* @BrightspaceUI/gaudi-dev
2+
package-lock.json

.github/dependabot.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
version: 2
22
updates:
3-
- package-ecosystem: npm
4-
directory: "/"
5-
schedule:
6-
interval: weekly
7-
open-pull-requests-limit: 10
8-
versioning-strategy: widen
9-
ignore:
10-
- dependency-name: mocha
11-
versions:
12-
- ">= 8.1.a, < 8.2"
3+
- package-ecosystem: npm
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 10
8+
ignore:
9+
# update-package-lock workflow already handles minor/patch updates
10+
- dependency-name: "*"
11+
update-types: ["version-update:semver-minor", "version-update:semver-patch"]

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ jobs:
2222
- name: Semantic Release
2323
uses: BrightspaceUI/actions/semantic-release@main
2424
with:
25-
GITHUB_TOKEN: ${{ secrets.D2L_GITHUB_TOKEN }}
25+
GITHUB_TOKEN: ${{ secrets.D2L_RELEASE_TOKEN }}
2626
NPM: true
2727
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Update package-lock.json
2+
on:
3+
schedule:
4+
- cron: "30 12 * * 3" # Wed 8:30AM EDT. 7:30AM EST.
5+
workflow_dispatch: # manual trigger
6+
jobs:
7+
update:
8+
name: Update
9+
timeout-minutes: 10
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: Brightspace/third-party-actions@actions/checkout
13+
with:
14+
token: ${{ secrets.PR_GITHUB_TOKEN }}
15+
- uses: Brightspace/third-party-actions@actions/setup-node
16+
with:
17+
node-version-file: .nvmrc
18+
cache: 'npm'
19+
- name: Update package-lock.json
20+
uses: BrightspaceUI/actions/update-package-lock@main
21+
with:
22+
AUTO_MERGE_METHOD: squash
23+
AUTO_MERGE_TOKEN: ${{ secrets.PR_GITHUB_TOKEN }}
24+
APPROVAL_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
GITHUB_TOKEN: ${{ secrets.PR_GITHUB_TOKEN }}

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18
1+
20

README.md

Lines changed: 9 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,11 @@ const separator = getSeparator({ nonBreaking: true }); // -> ',\xa0' in en-US
258258
Options:
259259
- **nonBreaking**: a Boolean flag, whether to use non-breaking spaces instead of standard spaces; default is `false`
260260

261-
## Running the test harness
261+
## Developing and Contributing
262+
263+
After cloning the repo, run `npm install` to install dependencies.
264+
265+
### Running the test harness
262266

263267
Start a [@web/dev-server](https://modern-web.dev/docs/dev-server/overview/) that hosts the test harness:
264268

@@ -268,45 +272,12 @@ npm start
268272

269273
This will let you test the intl library in a browser, and will update live with any changes.
270274

271-
## Contributing
275+
### Contributing
272276

273277
Contributions are welcome, please submit a pull request!
274278

275-
## Versioning & Releasing
276-
277-
> TL;DR: Commits prefixed with `fix:` and `feat:` will trigger patch and minor releases when merged to `main`. Read on for more details...
278-
279-
The [semantic-release GitHub Action](https://github.com/BrightspaceUI/actions/tree/main/semantic-release) is called from the `release.yml` GitHub Action workflow to handle version changes and releasing.
280-
281-
### Version Changes
282-
283-
All version changes should obey [semantic versioning](https://semver.org/) rules:
284-
1. **MAJOR** version when you make incompatible API changes,
285-
2. **MINOR** version when you add functionality in a backwards compatible manner, and
286-
3. **PATCH** version when you make backwards compatible bug fixes.
287-
288-
The next version number will be determined from the commit messages since the previous release. Our semantic-release configuration uses the [Angular convention](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular) when analyzing commits:
289-
* Commits which are prefixed with `fix:` or `perf:` will trigger a `patch` release. Example: `fix: validate input before using`
290-
* Commits which are prefixed with `feat:` will trigger a `minor` release. Example: `feat: add toggle() method`
291-
* To trigger a MAJOR release, include `BREAKING CHANGE:` with a space or two newlines in the footer of the commit message
292-
* Other suggested prefixes which will **NOT** trigger a release: `build:`, `ci:`, `docs:`, `style:`, `refactor:` and `test:`. Example: `docs: adding README for new component`
293-
294-
To revert a change, add the `revert:` prefix to the original commit message. This will cause the reverted change to be omitted from the release notes. Example: `revert: fix: validate input before using`.
295-
296-
### Releases
297-
298-
When a release is triggered, it will:
299-
* Update the version in `package.json`
300-
* Tag the commit
301-
* Create a GitHub release (including release notes)
302-
* Deploy a new package to NPM
303-
304-
### Releasing from Maintenance Branches
305-
306-
Occasionally you'll want to backport a feature or bug fix to an older release. `semantic-release` refers to these as [maintenance branches](https://semantic-release.gitbook.io/semantic-release/usage/workflow-configuration#maintenance-branches).
279+
### Versioning and Releasing
307280

308-
Maintenance branch names should be of the form: `+([0-9])?(.{+([0-9]),x}).x`.
281+
This repo is configured to use `semantic-release`. Commits prefixed with `fix:` and `feat:` will trigger patch and minor releases when merged to `main`.
309282

310-
Regular expressions are complicated, but this essentially means branch names should look like:
311-
* `1.15.x` for patch releases on top of the `1.15` release (after version `1.16` exists)
312-
* `2.x` for feature releases on top of the `2` release (after version `3` exists)
283+
To learn how to create major releases and release from maintenance branches, refer to the [semantic-release GitHub Action](https://github.com/BrightspaceUI/actions/tree/main/semantic-release) documentation.

0 commit comments

Comments
 (0)