Skip to content

Commit

Permalink
add eslint and github action
Browse files Browse the repository at this point in the history
  • Loading branch information
boillodmanuel committed Dec 1, 2020
1 parent dae80f2 commit 9881339
Show file tree
Hide file tree
Showing 20 changed files with 1,649 additions and 363 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# don't ever lint node_modules
node_modules
# don't lint build output (make sure it's set to your correct build folder name)
dist
16 changes: 16 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'prettier/@typescript-eslint',
],
rules: {
'@typescript-eslint/no-inferrable-types': "off",
}
};
7 changes: 7 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Used documentation

- [Action reference](https://github.com/actions/starter-workflows/tree/main/cihttps://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions)
- [Starter workflow samples](https://github.com/actions/starter-workflows/tree/main/ci)
- [Guide building-and-testing-nodejs](https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-nodejs)
- [Guide caching-dependencies](https://docs.github.com/en/free-pro-team@latest/actions/guides/caching-dependencies-to-speed-up-workflows)
- [Guide publishing-nodejs-packages](https://docs.github.com/en/free-pro-team@latest/actions/guides/publishing-nodejs-packages)
27 changes: 23 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Test library
name: CI

on: [push, pull_request]

jobs:
test:
ci:

runs-on: ubuntu-latest

Expand All @@ -19,6 +19,25 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- run: npm ci
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: node_${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
node_${{ matrix.node-version }}-
- name: Install Dependencies
run: npm ci

- name: Test
run: npm test
env:
CI: true

- name: Build
run: npm run build

- run: npm test
56 changes: 0 additions & 56 deletions .github/workflows/docker.yml.off

This file was deleted.

63 changes: 63 additions & 0 deletions .github/workflows/publish-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Publish Tag

on:
push:
tags:
- v*.*.* # Push events to v1.0.0, ...

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: "12.x"
registry-url: 'https://registry.npmjs.org'

- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
node
- name: Install Dependencies
run: npm ci

- name: Test
run: npm test
env:
CI: true

- name: Build
run: npm run build

- name: Publish to npmjs
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Extract changelog
run: |
VERSION="$(npm run --silent getVersion)"
cat CHANGELOG.md | sed -n "/## \[${VERSION}\]/,/## \[/p" | tail -n +2 | sed -e '$ d' > CHANGELOG_CURRENT_VERSION.md
- name: Create Github Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body_path: CHANGELOG_CURRENT_VERSION.md
draft: false
prerelease: false
35 changes: 0 additions & 35 deletions .github/workflows/release.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changes

## [Unreleased][]

### Added

- Release on new tag with github action

## [3.8.3][] - 2020-12-01

- Migration to typescript

## Version 3.8.3

* update dependencies (Fixes #86)
Expand Down Expand Up @@ -83,3 +93,7 @@
## Version 3.3.1

* update dependencies to avoid CVE-2018-3728


[Unreleased]: https://github.com/boillodmanuel/markdown-link-check/compare/v3.8.3...HEAD
[3.8.3]: https://github.com/boillodmanuel/markdown-link-check/tree/v3.8.3
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,15 @@ Contributing
npx ts-node src/bin/markdown-link-check.ts test/file1.md
npx ts-node src/bin/markdown-link-check.ts --inputs test/file1.md test/file2.md
```


# Release


Tag a new version with:

```bash
npm version major|minor|patch
```

Then github action will publish the tag and create a new release
17 changes: 0 additions & 17 deletions Dockerfile

This file was deleted.

7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,13 @@ npm test
```


## Test command line

```bash
npx markdown-link-check test/file1.md
npx markdown-link-check --inputs test/file1.md test/file2.md
```

## License

See [LICENSE.md](https://github.com/tcort/markdown-link-check/blob/master/LICENSE.md)
Loading

0 comments on commit 9881339

Please sign in to comment.