Skip to content
Open
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
16 changes: 16 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@ on:
pull_request:

jobs:
commitlint:
name: Linting PR Title / Commit messages
runs-on: ubuntu-latest
steps:
- id: auth
uses: jnwng/github-app-installation-token-action@v2
with:
appId: ${{ secrets.GITHUB_APP_ID }}
installationId: ${{ secrets.GITHUB_APP_INSTALLATION_ID }}
privateKey: ${{ secrets.ORG_PRIVATE_KEY }}
- uses: amannn/action-semantic-pull-request@v3.4.0
with:
validateSingleCommit: true
env:
GITHUB_TOKEN: ${{ steps.auth.outputs.token }}

getNodeVersion:
uses: gagoar/ts-node-template/.github/workflows/get_node_version.yml@main

Expand Down
24 changes: 17 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
branches:
- main

name: Release

jobs:
npm:
runs-on: ubuntu-latest
steps:
- id: auth
uses: jnwng/github-app-installation-token-action@v2
with:
appId: ${{ secrets.GITHUB_APP_ID }}
installationId: ${{ secrets.GITHUB_APP_INSTALLATION_ID }}
privateKey: ${{ secrets.ORG_PRIVATE_KEY }}
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: main
- uses: actions/setup-node@v2
with:
node-version: '12.x'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm run install
- run: npm run build
- run: npm run build-cli
- run: npm publish
- run: npm run semantic-release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ steps.auth.outputs.token }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
7 changes: 7 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env sh

# Sourcing husky helper script that consumes .huskyrc config and allows for debug parameters.
. "$(dirname "$0")/_/husky.sh"

# Hook actions below
npx commitlint --edit $1
7 changes: 7 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env sh

# Sourcing husky helper script that consumes .huskyrc config and allows for debug parameters.
. "$(dirname "$0")/_/husky.sh"

# Hook actions below
npx lint-staged
9 changes: 9 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env sh

# Sourcing husky helper script that consumes .huskyrc config and allows for debug parameters.
. "$(dirname "$0")/_/husky.sh"

# Hook actions below, in this case we utilize git-cz, which fallsback to regular `git commit`
# if for whatever reason commitizen is not installed. /dev/tty is used to ensure that commitizen
# can get user input.
exec < /dev/tty && npx git-cz --hook || true
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,30 @@
- [commander](https://github.com/tj/commander.js/)
- [cosmiconfig](https://github.com/davidtheclark/cosmiconfig)

## Getting Started

### Builds / Releases

#### Github Tokens

This template utilizes [github-app-installation-token-action](https://github.com/jnwng/github-app-installation-token-action) in order to interact with Github. As per the documentation, the following secrets are needed for proper operation:

```
appId: ${{ secrets.GITHUB_APP_ID }}
installationId: ${{ secrets.GITHUB_APP_INSTALLATION_ID }}
privateKey: ${{ secrets.ORG_PRIVATE_KEY }}
```

#### NPM Tokens

In order for the artifacts to be published, this template requires an NPM token exposed as:

```
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
```

If you wish to publish to a registry other than the default (`https://registry.npmjs.org`), such a change can be made in `.github/workflows/release.yml`.

## Contributing

Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated **greatly appreciated**.
Expand Down
Loading