Skip to content

Commit 752b69d

Browse files
authored
Merge pull request #30 from per1234/check-packaging
Change development policy to continuous packaging
2 parents 3cb05d8 + 01b5627 commit 752b69d

File tree

5 files changed

+3270
-126
lines changed

5 files changed

+3270
-126
lines changed

.github/CONTRIBUTING.md

Lines changed: 54 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,67 @@
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
213

314
To work on the codebase you have to install all the dependencies:
415

5-
```sh
6-
# npm install
716
```
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
835

936
To run tests set the environment variable `GITHUB_TOKEN` with a valid Personal Access Token and then:
1037

11-
```sh
12-
# npm run test
38+
```
39+
npm run test
1340
```
1441

1542
See the [official Github documentation][pat-docs] to learn more about Personal Access Tokens.
1643

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.
3066

3167
[pat-docs]: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Check Packaging
2+
3+
env:
4+
# See: https://github.com/actions/setup-node/#readme
5+
NODE_VERSION: 10.x
6+
7+
on:
8+
push:
9+
paths:
10+
- ".github/workflows/check-packaging-ncc-typescript-npm.yml"
11+
- "lerna.json"
12+
- "package.json"
13+
- "package-lock.json"
14+
- "Taskfile.ya?ml"
15+
- "tsconfig.json"
16+
- "**.[jt]sx?"
17+
pull_request:
18+
paths:
19+
- ".github/workflows/check-packaging-ncc-typescript-npm.yml"
20+
- "lerna.json"
21+
- "package.json"
22+
- "package-lock.json"
23+
- "Taskfile.ya?ml"
24+
- "tsconfig.json"
25+
- "**.[jt]sx?"
26+
workflow_dispatch:
27+
repository_dispatch:
28+
29+
jobs:
30+
check-packaging:
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v2
36+
37+
- name: Setup Node.js
38+
uses: actions/setup-node@v2
39+
with:
40+
node-version: ${{ env.NODE_VERSION }}
41+
42+
- name: Install dependencies
43+
run: npm install
44+
45+
- name: Build project
46+
run: |
47+
npm run-script build
48+
npm run-script pack
49+
50+
- name: Check packaging
51+
# Ignoring CR because ncc's output has a mixture of line endings, while the repository should only contain
52+
# Unix-style EOL.
53+
run: git diff --ignore-cr-at-eol --color --exit-code dist

.github/workflows/integration.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ jobs:
2121
- name: Checkout local repository
2222
uses: actions/checkout@v2
2323

24-
- name: Build action
25-
run: |
26-
npm install
27-
npm run build
28-
npm run pack
29-
3024
# Run the action using default values as much as possible.
3125
- name: Run action
3226
uses: ./ # Use the action from the local path.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![Tests Status](https://github.com/arduino/arduino-lint-action/workflows/Test%20Action/badge.svg)](https://github.com/arduino/arduino-lint-action/actions?workflow=Test+Action)
44
[![Integration Tests Status](https://github.com/arduino/arduino-lint-action/workflows/Integration%20Tests/badge.svg)](https://github.com/arduino/arduino-lint-action/actions?workflow=Integration+Tests)
5+
[![Check Packaging status](https://github.com/arduino/arduino-lint-action/actions/workflows/check-packaging-ncc-typescript-npm.yml/badge.svg)](https://github.com/arduino/arduino-lint-action/actions/workflows/check-packaging-ncc-typescript-npm.yml)
56
[![Spellcheck Status](https://github.com/arduino/arduino-lint-action/workflows/Spell%20Check/badge.svg)](https://github.com/arduino/arduino-lint-action/actions?workflow=Spell+Check)
67

78
[GitHub Actions](https://docs.github.com/en/free-pro-team@latest/actions) action that uses

0 commit comments

Comments
 (0)