Skip to content

Commit 9b90968

Browse files
author
Paul Marsicovetere
committed
GitHub Actions release workflow addition
1 parent 15573cc commit 9b90968

File tree

8 files changed

+1502
-90
lines changed

8 files changed

+1502
-90
lines changed

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": [
4+
"@svitejs/changesets-changelog-github-compact",
5+
{
6+
"repo": "FormidableLabs/webpack-dashboard"
7+
}
8+
],
9+
"access": "public",
10+
"baseBranch": "master"
11+
}

.changeset/plenty-spiders-sip.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"webpack-dashboard": patch
3+
---
4+
5+
Adding GitHub release workflow

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
release:
8+
name: Release
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
id-token: write
13+
issues: write
14+
repository-projects: write
15+
deployments: write
16+
packages: write
17+
pull-requests: write
18+
steps:
19+
- uses: actions/checkout@v2
20+
- uses: actions/setup-node@v3
21+
with:
22+
node-version: 18
23+
24+
- name: Install dependencies
25+
run: yarn install --frozen-lockfile
26+
27+
- name: Check CI
28+
run: yarn check-ci
29+
30+
- name: PR or Publish
31+
id: changesets
32+
uses: changesets/action@v1
33+
with:
34+
version: yarn changeset version
35+
publish: yarn changeset publish
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributing to Webpack-Dashboard
2+
3+
## Contributor Covenant Code of Conduct
4+
5+
### Our Pledge
6+
7+
In the interest of fostering an open and welcoming environment, we as
8+
contributors and maintainers pledge to making participation in our project and
9+
our community a harassment-free experience for everyone, regardless of age, body
10+
size, disability, ethnicity, gender identity and expression, level of experience,
11+
nationality, personal appearance, race, religion, or sexual identity and
12+
orientation.
13+
14+
### Our Standards
15+
16+
Examples of behavior that contributes to creating a positive environment
17+
include:
18+
19+
- Using welcoming and inclusive language
20+
- Being respectful of differing viewpoints and experiences
21+
- Gracefully accepting constructive criticism
22+
- Focusing on what is best for the community
23+
- Showing empathy towards other community members
24+
25+
Examples of unacceptable behavior by participants include:
26+
27+
- The use of sexualized language or imagery and unwelcome sexual attention or
28+
advances
29+
- Trolling, insulting/derogatory comments, and personal or political attacks
30+
- Public or private harassment
31+
- Publishing others' private information, such as a physical or electronic
32+
address, without explicit permission
33+
- Other conduct which could reasonably be considered inappropriate in a
34+
professional setting
35+
36+
### Our Responsibilities
37+
38+
Project maintainers are responsible for clarifying the standards of acceptable
39+
behavior and are expected to take appropriate and fair corrective action in
40+
response to any instances of unacceptable behavior.
41+
42+
Project maintainers have the right and responsibility to remove, edit, or
43+
reject comments, commits, code, wiki edits, issues, and other contributions
44+
that are not aligned to this Code of Conduct, or to ban temporarily or
45+
permanently any contributor for other behaviors that they deem inappropriate,
46+
threatening, offensive, or harmful.
47+
48+
### Scope
49+
50+
This Code of Conduct applies both within project spaces and in public spaces
51+
when an individual is representing the project or its community. Examples of
52+
representing a project or community include using an official project e-mail
53+
address, posting via an official social media account, or acting as an appointed
54+
representative at an online or offline event. Representation of a project may be
55+
further defined and clarified by project maintainers.
56+
57+
### Enforcement
58+
59+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
60+
reported by contacting the project team at [email protected]. All
61+
complaints will be reviewed and investigated and will result in a response that
62+
is deemed necessary and appropriate to the circumstances. The project team is
63+
obligated to maintain confidentiality with regard to the reporter of an incident.
64+
Further details of specific enforcement policies may be posted separately.
65+
66+
Project maintainers who do not follow or enforce the Code of Conduct in good
67+
faith may face temporary or permanent repercussions as determined by other
68+
members of the project's leadership.
69+
70+
### Attribution
71+
72+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
73+
available at [http://contributor-covenant.org/version/1/4][version]
74+
75+
[homepage]: http://contributor-covenant.org
76+
[version]: http://contributor-covenant.org/version/1/4/

CONTRIBUTING.md

Lines changed: 50 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,69 @@
1-
# Contributing to Webpack-Dashboard
1+
## Development
22

3-
## Contributor Covenant Code of Conduct
3+
### Installing dependencies
44

5-
### Our Pledge
5+
```sh
6+
yarn install
7+
```
68

7-
In the interest of fostering an open and welcoming environment, we as
8-
contributors and maintainers pledge to making participation in our project and
9-
our community a harassment-free experience for everyone, regardless of age, body
10-
size, disability, ethnicity, gender identity and expression, level of experience,
11-
nationality, personal appearance, race, religion, or sexual identity and
12-
orientation.
9+
### Testing
1310

14-
### Our Standards
11+
You will find tests for files colocated with `*.test.ts` suffixes. Whenever making any changes, ensure that all existing tests pass by running `yarn test`.
1512

16-
Examples of behavior that contributes to creating a positive environment
17-
include:
13+
If you are adding a new feature or some extra functionality, you should also make sure to accompany those changes with appropriate tests.
1814

19-
* Using welcoming and inclusive language
20-
* Being respectful of differing viewpoints and experiences
21-
* Gracefully accepting constructive criticism
22-
* Focusing on what is best for the community
23-
* Showing empathy towards other community members
15+
### Linting and Formatting
2416

25-
Examples of unacceptable behavior by participants include:
17+
Before committing any changes, be sure to do `yarn lint`; this will lint all relevant files using [ESLint](http://eslint.org/) and report on any changes that you need to make.
2618

27-
* The use of sexualized language or imagery and unwelcome sexual attention or
28-
advances
29-
* Trolling, insulting/derogatory comments, and personal or political attacks
30-
* Public or private harassment
31-
* Publishing others' private information, such as a physical or electronic
32-
address, without explicit permission
33-
* Other conduct which could reasonably be considered inappropriate in a
34-
professional setting
19+
### Before submitting a PR...
3520

36-
### Our Responsibilities
21+
Thanks for taking the time to help us make webpack-dashboard even better! Before you go ahead and submit a PR, make sure that you have done the following:
3722

38-
Project maintainers are responsible for clarifying the standards of acceptable
39-
behavior and are expected to take appropriate and fair corrective action in
40-
response to any instances of unacceptable behavior.
23+
- Run the tests using `yarn test`
24+
- Run lint and flow using `yarn lint`
25+
- Run `yarn changeset`
4126

42-
Project maintainers have the right and responsibility to remove, edit, or
43-
reject comments, commits, code, wiki edits, issues, and other contributions
44-
that are not aligned to this Code of Conduct, or to ban temporarily or
45-
permanently any contributor for other behaviors that they deem inappropriate,
46-
threatening, offensive, or harmful.
27+
### Using changesets
4728

48-
### Scope
29+
Our official release path is to use automation to perform the actual publishing of our packages. The steps are to:
4930

50-
This Code of Conduct applies both within project spaces and in public spaces
51-
when an individual is representing the project or its community. Examples of
52-
representing a project or community include using an official project e-mail
53-
address, posting via an official social media account, or acting as an appointed
54-
representative at an online or offline event. Representation of a project may be
55-
further defined and clarified by project maintainers.
31+
1. A human developer adds a changeset. Ideally this is as a part of a PR that will have a version impact on a package.
32+
2. On merge of a PR our automation system opens a "Version Packages" PR.
33+
3. On merging the "Version Packages" PR, the automation system publishes the packages.
5634

57-
### Enforcement
35+
Here are more details:
5836

59-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
60-
reported by contacting the project team at [email protected]. All
61-
complaints will be reviewed and investigated and will result in a response that
62-
is deemed necessary and appropriate to the circumstances. The project team is
63-
obligated to maintain confidentiality with regard to the reporter of an incident.
64-
Further details of specific enforcement policies may be posted separately.
37+
### Add a changeset
6538

66-
Project maintainers who do not follow or enforce the Code of Conduct in good
67-
faith may face temporary or permanent repercussions as determined by other
68-
members of the project's leadership.
39+
When you would like to add a changeset (which creates a file indicating the type of change), in your branch/PR issue this command:
6940

70-
### Attribution
41+
```sh
42+
$ yarn changeset
43+
```
7144

72-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
73-
available at [http://contributor-covenant.org/version/1/4][version]
45+
to produce an interactive menu. Navigate the packages with arrow keys and hit `<space>` to select 1+ packages. Hit `<return>` when done. Select semver versions for packages and add appropriate messages. From there, you'll be prompted to enter a summary of the change. Some tips for this summary:
7446

75-
[homepage]: http://contributor-covenant.org
76-
[version]: http://contributor-covenant.org/version/1/4/
47+
1. Aim for a single line, 1+ sentences as appropriate.
48+
2. Include issue links in GH format (e.g. `#123`).
49+
3. You don't need to reference the current pull request or whatnot, as that will be added later automatically.
50+
51+
After this, you'll see a new uncommitted file in `.changesets` like:
52+
53+
```sh
54+
$ git status
55+
# ....
56+
Untracked files:
57+
(use "git add <file>..." to include in what will be committed)
58+
.changeset/flimsy-pandas-marry.md
59+
```
60+
61+
Review the file, make any necessary adjustments, and commit it to source. When we eventually do a package release, the changeset notes and version will be incorporated!
62+
63+
### Creating versions
64+
65+
On a merge of a feature PR, the changesets GitHub action will open a new PR titled `"Version Packages"`. This PR is automatically kept up to date with additional PRs with changesets. So, if you're not ready to publish yet, just keep merging feature PRs and then merge the version packages PR later.
66+
67+
### Publishing packages
68+
69+
On the merge of a version packages PR, the changesets GitHub action will publish the packages to npm.

README.md

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -158,26 +158,9 @@ $ cross-env EXAMPLE=tree-shaking WEBPACK_MODE=production \
158158

159159
Then just run `yarn dev` to get up and running. PRs are very much appreciated!
160160

161-
### Publishing
161+
## Contributing
162162

163-
When it comes time to publish a new version of `webpack-dashboard` to `npm`, authorized users can take the following steps:
164-
165-
```sh
166-
# Ensure build passes all CI checks.
167-
git pull origin master
168-
yarn check-ci
169-
170-
# Version the change. We use semantic versioning.
171-
yarn version --<major | minor | patch>
172-
173-
# Publish to npm.
174-
yarn publish
175-
176-
# Commit the release tag to source.
177-
git push && git push --tags
178-
```
179-
180-
Please also be sure to update `CHANGELOG.md` with release notes and draft the release on GitHub. We loosely follow the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) spec with categories for `Features`, `Bugs`, `Tests`, `Docs`, and `Security`. All releases should also include `Migration Instructions` for adopting the new release.
163+
Please see our [contributing guide](CONTRIBUTING.MD).
181164

182165
#### Credits
183166

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@
3535
"bugs": {
3636
"url": "https://github.com/FormidableLabs/webpack-dashboard/issues"
3737
},
38-
"homepage": "https://github.com/FormidableLabs/webpack-dashboard#readme",
38+
"homepage": "https://github.com/FormidableLabs/webpack-dashboard",
3939
"peerDependencies": {
4040
"webpack": "*"
4141
},
4242
"dependencies": {
43+
"@changesets/cli": "^2.26.1",
4344
"chalk": "^4.1.1",
4445
"commander": "^8.0.0",
4546
"cross-spawn": "^7.0.3",
@@ -51,6 +52,7 @@
5152
"socket.io-client": "^4.1.3"
5253
},
5354
"devDependencies": {
55+
"@svitejs/changesets-changelog-github-compact": "^0.1.1",
5456
"babel-eslint": "^10.1.0",
5557
"chai": "^4.3.4",
5658
"codecov": "^3.8.2",
@@ -73,5 +75,8 @@
7375
"webpack": "^5.44.0",
7476
"webpack-cli": "^4.7.2",
7577
"webpack-stats-plugin": "^1.0.3"
78+
},
79+
"publishConfig": {
80+
"provenance": true
7681
}
7782
}

0 commit comments

Comments
 (0)