Skip to content

Commit a81dc9d

Browse files
authored
Merge pull request #40 from MatteoPologruto/check-packaging
Change development policy to continuous packaging
2 parents cb1819a + 7c15626 commit a81dc9d

File tree

3 files changed

+152
-12
lines changed

3 files changed

+152
-12
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Check Packaging
2+
3+
env:
4+
# See: https://github.com/actions/setup-node/#readme
5+
NODE_VERSION: 16.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+
- "tsconfig.json"
15+
- "**.[jt]sx?"
16+
pull_request:
17+
paths:
18+
- ".github/workflows/check-packaging-ncc-typescript-npm.yml"
19+
- "lerna.json"
20+
- "package.json"
21+
- "package-lock.json"
22+
- "tsconfig.json"
23+
- "**.[jt]sx?"
24+
workflow_dispatch:
25+
repository_dispatch:
26+
27+
jobs:
28+
check-packaging:
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v3
34+
35+
- name: Setup Node.js
36+
uses: actions/setup-node@v3
37+
with:
38+
node-version: ${{ env.NODE_VERSION }}
39+
40+
- name: Install dependencies
41+
run: npm install
42+
43+
- name: Build project
44+
run: |
45+
npm run-script build
46+
npm run-script pack
47+
48+
- name: Check packaging
49+
# Ignoring CR because ncc's output has a mixture of line endings, while the repository should only contain
50+
# Unix-style EOL.
51+
run: git diff --ignore-cr-at-eol --color --exit-code dist
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Integration Tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
schedule: # Scheduled trigger checks for breakage caused by changes to create-changelog
7+
# run every Tuesday at 3 AM UTC
8+
- cron: "0 3 * * 2"
9+
# workflow_dispatch event allows the workflow to be triggered manually
10+
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch
11+
workflow_dispatch:
12+
# repository_dispatch event allows the workflow to be triggered via the GitHub API
13+
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#repository_dispatch
14+
repository_dispatch:
15+
16+
jobs:
17+
defaults:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout local repository
22+
uses: actions/checkout@v3
23+
24+
# Run the action using default values as much as possible.
25+
- name: Run action
26+
uses: ./ # Use the action from the local path.
27+
28+
expected-pass:
29+
runs-on: ubuntu-latest
30+
31+
env:
32+
CHANGELOG_FILE_PATH: /tmp/CHANGELOG.md
33+
steps:
34+
- name: Checkout local repository
35+
uses: actions/checkout@v3
36+
37+
- name: Run action
38+
uses: ./
39+
with:
40+
tag-regex: '^[0-9]+\.[0-9]+\.[0-9]+.*$'
41+
case-insensitive-regex: true
42+
changelog-file-path: "${{ env.CHANGELOG_FILE_PATH }}"
43+
44+
- name: Verify report file exists
45+
run: |
46+
[ -e "${{ env.CHANGELOG_FILE_PATH }}" ]

README.md

Lines changed: 55 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Create Changelog
22

33
[![Actions Status](https://github.com/arduino/create-changelog/workflows/Test%20Action/badge.svg)](https://github.com/arduino/create-changelog/actions)
4+
[![Check Packaging status](https://github.com/arduino/create-changelog/actions/workflows/check-packaging-ncc-typescript-npm.yml/badge.svg)](https://github.com/arduino/create-changelog/actions/workflows/check-packaging-ncc-typescript-npm.yml)
5+
[![Integration Tests status](https://github.com/arduino/create-changelog/actions/workflows/test-integration.yml/badge.svg)](https://github.com/arduino/create-changelog/actions/workflows/test-integration.yml)
46

57
This actions is an highly opinionated tool that creates changelogs from the git repository commit history.
68

@@ -73,30 +75,71 @@ The action accepts some properties:
7375
case-insensitive-regex: true
7476
```
7577
76-
## Development
78+
## Development workflow
79+
80+
### 1. Install tools
81+
82+
#### Node.js
83+
84+
[**npm**](https://www.npmjs.com/) is used for dependency management.
85+
86+
Follow the installation instructions here:<br />
87+
https://nodejs.dev/download
88+
89+
### 2. Install dependencies
7790
7891
To work on the codebase you have to install all the dependencies:
7992
80-
```sh
81-
# npm install
8293
```
94+
npm install
95+
```
96+
97+
### 3. Coding
98+
99+
Now you're ready to work some [TypeScript](https://www.typescriptlang.org/) magic!
100+
101+
Make sure to write or update tests for your work when appropriate.
102+
103+
### 4. Format code
104+
105+
Format the code to follow the standard style for the project:
106+
107+
```
108+
npm run format
109+
```
110+
111+
### 5. Run tests
83112
84113
To run tests:
85114
86-
```sh
87-
# npm run test
115+
```
116+
npm run test
88117
```
89118
90119
See the [official Github documentation][pat-docs] to know more about Personal Access Tokens.
91120
92-
## Release
121+
### 6. Build
122+
123+
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:
124+
125+
```
126+
npm run build
127+
npm run pack
128+
```
129+
130+
### 7. Commit
131+
132+
Everything is now ready to make your contribution to the project, so commit it to the repository and submit a pull request.
133+
134+
Thanks!
135+
136+
## Release workflow
137+
138+
Instructions for releasing a new version of the action:
93139
94-
1. `npm install` to add all the dependencies, included development.
95-
2. `npm run build` to build the Action under the `./lib` folder.
96-
3. `npm run test` to see everything works as expected.
97-
4. `npm run pack` to package for distribution
98-
5. `git add src dist` to check in the code that matters.
99-
6. open a PR and request a review.
140+
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`).
141+
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/).
142+
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.
100143
101144
[pat-docs]: https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token
102145

0 commit comments

Comments
 (0)