Skip to content

Commit 21b2e00

Browse files
GitHub Actions release workflow addition (#155)
* GitHub Actions release workflow addition
1 parent eaa196d commit 21b2e00

File tree

7 files changed

+1394
-12
lines changed

7 files changed

+1394
-12
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/config@2.3.0/schema.json",
3+
"changelog": [
4+
"@svitejs/changesets-changelog-github-compact",
5+
{
6+
"repo": "FormidableLabs/react-native-owl"
7+
}
8+
],
9+
"access": "public",
10+
"baseBranch": "main"
11+
}

.changeset/fast-dodos-roll.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'react-native-owl': patch
3+
---
4+
5+
Addition of GitHub release workflow

.github/CONTRIBUTING.MD

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
Thank you for contributing!
2+
3+
## Development
4+
5+
### Installing dependencies
6+
7+
```sh
8+
yarn install
9+
```
10+
11+
### Testing
12+
13+
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`.
14+
15+
If you are adding a new feature or some extra functionality, you should also make sure to accompany those changes with appropriate tests.
16+
17+
### Linting and Formatting
18+
19+
Before committing any changes, be sure to do `yarn prettier:check` and `yarn prettier:apply`; this will lint all relevant files using [ESLint](http://eslint.org/) and report on any changes that you need to make.
20+
21+
### Before submitting a PR...
22+
23+
Thanks for taking the time to help us make react-native-owl even better! Before you go ahead and submit a PR, make sure that you have done the following:
24+
25+
- Run the tests using `yarn test`.
26+
- Run lint and flow using `yarn prettier:check` and `yarn prettier:apply`
27+
- Run `yarn changeset`
28+
29+
### Using changesets
30+
31+
Our official release path is to use automation to perform the actual publishing of our packages. The steps are to:
32+
33+
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.
34+
2. On merge of a PR our automation system opens a "Version Packages" PR.
35+
3. On merging the "Version Packages" PR, the automation system publishes the packages.
36+
37+
Here are more details:
38+
39+
### Add a changeset
40+
41+
When you would like to add a changeset (which creates a file indicating the type of change), in your branch/PR issue this command:
42+
43+
```sh
44+
$ yarn changeset
45+
```
46+
47+
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:
48+
49+
1. Aim for a single line, 1+ sentences as appropriate.
50+
2. Include issue links in GH format (e.g. `#123`).
51+
3. You don't need to reference the current pull request or whatnot, as that will be added later automatically.
52+
53+
After this, you'll see a new uncommitted file in `.changesets` like:
54+
55+
```sh
56+
$ git status
57+
# ....
58+
Untracked files:
59+
(use "git add <file>..." to include in what will be committed)
60+
.changeset/flimsy-pandas-marry.md
61+
```
62+
63+
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!
64+
65+
### Creating versions
66+
67+
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.
68+
69+
### Publishing packages
70+
71+
On the merge of a version packages PR, the changesets GitHub action will publish the packages to npm.

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- main
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: Typescript Build
28+
run: yarn build
29+
30+
- name: Unit Tests
31+
run: yarn test
32+
33+
- name: PR or Publish
34+
id: changesets
35+
uses: changesets/action@v1
36+
with:
37+
version: yarn changeset version
38+
publish: yarn changeset publish
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ when you first get started:
3535

3636
_You can find the raw markdown files inside this repository's `docs` folder._
3737

38+
## Contributing
39+
40+
Please see our [contributing guide](./.github/CONTRIBUTING.MD).
41+
3842
## Maintenance Status
3943

4044
**Active:** Formidable is actively working on this project, and we expect to continue work on this project for the foreseeable future. Bug reports, feature requests and pull requests are welcome.

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"prettier:apply": "prettier --write 'lib/**/*.{js,ts,tsx}'",
2626
"test": "yarn jest"
2727
},
28-
"repository": "https://github.com/FormidableLabs/react-native-owl.git",
28+
"repository": "https://github.com/FormidableLabs/react-native-owl",
2929
"author": "Emmanouil Konstantinidis <hello@manos.im>",
3030
"license": "MIT",
3131
"keywords": [
@@ -58,6 +58,8 @@
5858
"react-native": "^0"
5959
},
6060
"devDependencies": {
61+
"@changesets/cli": "^2.26.1",
62+
"@svitejs/changesets-changelog-github-compact": "^0.1.1",
6163
"@types/jest": "^26.0.19",
6264
"@types/pixelmatch": "^5.2.4",
6365
"@types/pngjs": "^6.0.1",
@@ -72,5 +74,8 @@
7274
"react-native": "^0.68.2",
7375
"ts-jest": "^26.4.4",
7476
"typescript": "^4.4.4"
77+
},
78+
"publishConfig": {
79+
"provenance": true
7580
}
7681
}

0 commit comments

Comments
 (0)