-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(template): update template structure
- Loading branch information
Ahmad Nassri
committed
Feb 9, 2021
1 parent
b687505
commit fe7fc4d
Showing
20 changed files
with
5,471 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
- match: | ||
dependency_type: development | ||
update_type: semver:minor # includes patch updates! | ||
|
||
- match: | ||
dependency_type: production | ||
update_type: security:minor # includes patch updates! | ||
|
||
- match: | ||
dependency_type: production | ||
update_type: semver:patch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
- package-ecosystem: gitsubmodule | ||
open-pull-requests-limit: 10 | ||
directory: "/" | ||
directory: / | ||
commit-message: | ||
prefix: build | ||
prefix-development: chore | ||
include: scope | ||
schedule: | ||
interval: "daily" | ||
interval: daily | ||
|
||
- package-ecosystem: "npm" | ||
- package-ecosystem: npm | ||
open-pull-requests-limit: 10 | ||
directory: "/" | ||
directory: / | ||
commit-message: | ||
prefix: build | ||
prefix-development: chore | ||
include: scope | ||
schedule: | ||
interval: "daily" | ||
|
||
interval: daily |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
extends: | ||
- "@commitlint/config-conventional" | ||
rules: | ||
body-max-line-length: [2, 'always', 200] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: auto-merge | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
auto-merge: | ||
timeout-minutes: 5 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ahmadnassri/action-dependabot-auto-merge@v2 | ||
with: | ||
github-token: ${{ secrets.GH_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: commit-lint | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
commit-lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ahmadnassri/action-commit-lint@v1 | ||
with: | ||
config: .github/linters/.commit-lint.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: readme | ||
|
||
on: | ||
push: | ||
branches: master | ||
paths: | ||
- docs/** | ||
- colophon.yml | ||
- .github/workflows/readme.yml | ||
|
||
jobs: | ||
readme: | ||
timeout-minutes: 5 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: docker://pandoc/core:2.11.4 | ||
with: | ||
args: >- | ||
--metadata-file=colophon.yml | ||
--template=docs/README.template | ||
--output=README.md | ||
--from=gfm | ||
--to=gfm | ||
--fail-if-warnings | ||
--wrap=preserve | ||
docs/README.md | ||
- uses: actions/github-script@v3 | ||
with: | ||
github-token: ${{secrets.GH_TOKEN}} | ||
script: | | ||
const { readFileSync } = require('fs') | ||
const path = 'README.md' | ||
const content = readFileSync(`${process.env.GITHUB_WORKSPACE}/${path}`) | ||
const { data } = await github.repos.getContent({ ...context.repo, path }) | ||
if (Buffer.from(data.content, 'base64').compare(content) === 0) return | ||
await github.repos.createOrUpdateFileContents({...context.repo, path, | ||
sha: data.sha, | ||
message: 'docs(readme): update readme', | ||
content: content.toString('base64') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,55 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_run: | ||
workflows: [ test ] | ||
branches: [ master ] | ||
types: [ completed ] | ||
|
||
jobs: | ||
dependencies: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
|
||
# run checks | ||
- run: npm audit --audit-level=moderate | ||
- run: npx updated | ||
release: | ||
timeout-minutes: 5 | ||
|
||
test: | ||
needs: dependencies | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
node-version: [10, 12, 13, 14] | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
|
||
runs-on: ${{ matrix.os }} | ||
outputs: | ||
published: ${{ steps.release.outputs.published }} | ||
version: ${{ steps.release.outputs.release-version }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
path: ~/.npm | ||
key: client-${{ hashFiles('**/package-lock.json') }} | ||
submodules: true | ||
|
||
- uses: actions/[email protected] | ||
- id: release | ||
uses: ahmadnassri/action-semantic-release@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
config: ${{ github.workspace }}/.semantic.json | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
|
||
# run test | ||
- run: npm ci | ||
- run: npm run test | ||
mirror: | ||
needs: release | ||
|
||
release: | ||
needs: test | ||
timeout-minutes: 5 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
if: needs.release.outputs.published == 'true' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
|
||
# release | ||
- run: npx semantic-release | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
submodules: true | ||
|
||
- name: publish to github registry | ||
run: | | ||
jq '.name = "@'${GITHUB_REPOSITORY/node-/}'"' package.json > /tmp/package.json; mv /tmp/package.json . | ||
npm config --userconfig .npmrc set registry=https://npm.pkg.github.com/${{ github.repository_owner }} | ||
npm config --userconfig .npmrc set //npm.pkg.github.com/:_authToken ${{ secrets.GH_TOKEN }} | ||
npm config --userconfig .npmrc set always-auth true | ||
npm version --no-git-tag-version v${{ needs.release.outputs.version }} | ||
npm publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,30 @@ | ||
name: super-linter | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- master | ||
on: [ push, pull_request ] | ||
|
||
jobs: | ||
super-linter: | ||
deduplicate: | ||
timeout-minutes: 5 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
# run on external PRs, but on internal PRs as they'll be run by the push to the branch. | ||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | ||
|
||
steps: | ||
- run: echo ::warning ::skipped duplicate run | ||
|
||
lint: | ||
timeout-minutes: 5 | ||
|
||
needs: deduplicate | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: docker://github/super-linter:v3 | ||
- uses: github/super-linter@v3 | ||
env: | ||
LOG_LEVEL: ERROR | ||
VALIDATE_ALL_CODEBASE: false | ||
GITHUB_TOKEN: ${{ github.token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,59 @@ | ||
name: test | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- master | ||
on: [ push, pull_request ] | ||
|
||
env: | ||
NODE_ENV: test | ||
|
||
jobs: | ||
dependencies: | ||
deduplicate: | ||
timeout-minutes: 5 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
# run on external PRs, but on internal PRs as they'll be run by the push to the branch. | ||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
- run: echo ::warning ::skipped duplicate run | ||
|
||
audit: | ||
timeout-minutes: 5 | ||
|
||
# run checks | ||
- run: npm audit --audit-level=moderate | ||
- run: npx updated | ||
needs: deduplicate | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
- uses: actions/checkout@v2 | ||
- run: npm audit --audit-level=critical | ||
|
||
test: | ||
needs: dependencies | ||
timeout-minutes: 5 | ||
|
||
needs: audit | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
node-version: [10, 12, 13, 14] | ||
node-version: [12, 14, 15] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
path: ~/.npm | ||
key: client-${{ hashFiles('**/package-lock.json') }} | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
key: ${{ matrix.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} | ||
|
||
# run test | ||
- run: npm ci | ||
- run: npm run test | ||
- run: npm run test:ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
*.log | ||
/.nyc_output | ||
/coverage | ||
/node_modules | ||
.nyc_output | ||
coverage | ||
node_modules |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.