|
1 |
| -## Development |
| 1 | +## Development workflow |
| 2 | + |
| 3 | +### 1. Install tools |
| 4 | + |
| 5 | +#### Node.js |
| 6 | + |
| 7 | +[**npm**](https://www.npmjs.com/) is used for dependency management. |
| 8 | + |
| 9 | +Follow the installation instructions here:<br /> |
| 10 | +https://nodejs.dev/download |
| 11 | + |
| 12 | +### 2. Install dependencies |
2 | 13 |
|
3 | 14 | To work on the codebase you have to install all the dependencies:
|
4 | 15 |
|
5 |
| -```sh |
6 |
| -# npm install |
7 | 16 | ```
|
| 17 | +npm install |
| 18 | +``` |
| 19 | + |
| 20 | +### 3. Coding |
| 21 | + |
| 22 | +Now you're ready to work some [TypeScript](https://www.typescriptlang.org/) magic! |
| 23 | + |
| 24 | +Make sure to write or update tests for your work when appropriate. |
| 25 | + |
| 26 | +### 4. Format code |
| 27 | + |
| 28 | +Format the code to follow the standard style for the project: |
| 29 | + |
| 30 | +``` |
| 31 | +npm run format |
| 32 | +``` |
| 33 | + |
| 34 | +### 5. Run tests |
8 | 35 |
|
9 | 36 | To run tests set the environment variable `GITHUB_TOKEN` with a valid Personal Access Token and then:
|
10 | 37 |
|
11 |
| -```sh |
12 |
| -# npm run test |
| 38 | +``` |
| 39 | +npm run test |
13 | 40 | ```
|
14 | 41 |
|
15 | 42 | See the [official Github documentation][pat-docs] to learn more about Personal Access Tokens.
|
16 | 43 |
|
17 |
| -## Release |
18 |
| - |
19 |
| -1. `npm install` to add all the dependencies, included development. |
20 |
| -1. `npm run build` to build the Action under the `./lib` folder. |
21 |
| -1. `npm run test` to see everything works as expected. |
22 |
| -1. `npm run pack` to package for distribution |
23 |
| -1. `git add src dist` to check in the code that matters. |
24 |
| -1. If the release will increment the major version, update the action refs in the examples in README.md |
25 |
| - (e.g., `uses: arduino/arduino-lint-action@v1` -> `uses: arduino/arduino-lint-action@v2`). |
26 |
| -1. open a PR and request a review. |
27 |
| -1. After PR is merged, create a release, following the `vX.X.X` tag name convention. |
28 |
| -1. After the release, rebase the release branch for that major version (e.g., `v1` branch for the v1.x.x tags) on the |
29 |
| - tag. If no branch exists for the release's major version, create one. |
| 44 | +### 6. Build |
| 45 | + |
| 46 | +It is necessary to compile the code before it can be used by GitHub Actions. Remember to run these commands before committing any code changes: |
| 47 | + |
| 48 | +``` |
| 49 | +npm run build |
| 50 | +npm run pack |
| 51 | +``` |
| 52 | + |
| 53 | +### 7. Commit |
| 54 | + |
| 55 | +Everything is now ready to make your contribution to the project, so commit it to the repository and submit a pull request. |
| 56 | + |
| 57 | +Thanks! |
| 58 | + |
| 59 | +## Release workflow |
| 60 | + |
| 61 | +Instructions for releasing a new version of the action: |
| 62 | + |
| 63 | +1. If the release will increment the major version, update the action refs in the examples in `README.md` (e.g., `uses: arduino/arduino-lint-action@v1` -> `uses: arduino/arduino-lint-action@v2`). |
| 64 | +1. Create a [GitHub release](https://docs.github.com/en/github/administering-a-repository/managing-releases-in-a-repository#creating-a-release), following the `vX.Y.Z` tag name convention. Make sure to follow [the SemVer specification](https://semver.org/). |
| 65 | +1. Rebase the release branch for that major version (e.g., `v1` branch for the `v1.x.x` tags) on the tag. If no branch exists for the release's major version, create one. |
30 | 66 |
|
31 | 67 | [pat-docs]: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
|
0 commit comments