Skip to content

Change development policy to continuous packaging #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 54 additions & 18 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,67 @@
## Development
## Development workflow

### 1. Install tools

#### Node.js

[**npm**](https://www.npmjs.com/) is used for dependency management.

Follow the installation instructions here:<br />
https://nodejs.dev/download

### 2. Install dependencies

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

```sh
# npm install
```
npm install
```

### 3. Coding

Now you're ready to work some [TypeScript](https://www.typescriptlang.org/) magic!

Make sure to write or update tests for your work when appropriate.

### 4. Format code

Format the code to follow the standard style for the project:

```
npm run format
```

### 5. Run tests

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

```sh
# npm run test
```
npm run test
```

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

## Release

1. `npm install` to add all the dependencies, included development.
1. `npm run build` to build the Action under the `./lib` folder.
1. `npm run test` to see everything works as expected.
1. `npm run pack` to package for distribution
1. `git add src dist` to check in the code that matters.
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`).
1. open a PR and request a review.
1. After PR is merged, create a release, following the `vX.X.X` tag name convention.
1. After the release, 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.
### 6. Build

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:

```
npm run build
npm run pack
```

### 7. Commit

Everything is now ready to make your contribution to the project, so commit it to the repository and submit a pull request.

Thanks!

## Release workflow

Instructions for releasing a new version of the action:

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`).
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/).
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.

[pat-docs]: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
53 changes: 53 additions & 0 deletions .github/workflows/check-packaging-ncc-typescript-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Check Packaging

env:
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: 10.x

on:
push:
paths:
- ".github/workflows/check-packaging-ncc-typescript-npm.yml"
- "lerna.json"
- "package.json"
- "package-lock.json"
- "Taskfile.ya?ml"
- "tsconfig.json"
- "**.[jt]sx?"
pull_request:
paths:
- ".github/workflows/check-packaging-ncc-typescript-npm.yml"
- "lerna.json"
- "package.json"
- "package-lock.json"
- "Taskfile.ya?ml"
- "tsconfig.json"
- "**.[jt]sx?"
workflow_dispatch:
repository_dispatch:

jobs:
check-packaging:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install dependencies
run: npm install

- name: Build project
run: |
npm run-script build
npm run-script pack

- name: Check packaging
# Ignoring CR because ncc's output has a mixture of line endings, while the repository should only contain
# Unix-style EOL.
run: git diff --ignore-cr-at-eol --color --exit-code dist
6 changes: 0 additions & 6 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ jobs:
- name: Checkout local repository
uses: actions/checkout@v2

- name: Build action
run: |
npm install
npm run build
npm run pack

# Run the action using default values as much as possible.
- name: Run action
uses: ./ # Use the action from the local path.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![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)
[![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)
[![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)
[![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)

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