-
-
Notifications
You must be signed in to change notification settings - Fork 1
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 to match ahmadnassri/template-node-lib
- Loading branch information
Ahmad Nassri
committed
Feb 28, 2021
1 parent
9a3a486
commit 34105cb
Showing
23 changed files
with
716 additions
and
256 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
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 @@ | ||
# ----------------------------------------------------------- # | ||
# Note: this file originates in ahmadnassri/template-template # | ||
# ----------------------------------------------------------- # | ||
|
||
- match: | ||
dependency_type: development | ||
update_type: semver:minor | ||
|
||
- match: | ||
dependency_type: production | ||
update_type: security:minor | ||
|
||
- 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,45 @@ | ||
# ----------------------------------------------------------- # | ||
# Note: this file originates in ahmadnassri/template-template # | ||
# ----------------------------------------------------------- # | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: gitsubmodule | ||
open-pull-requests-limit: 10 | ||
directory: / | ||
commit-message: | ||
prefix: build | ||
prefix-development: chore | ||
include: scope | ||
schedule: | ||
interval: daily | ||
|
||
- package-ecosystem: github-actions | ||
open-pull-requests-limit: 10 | ||
directory: / | ||
commit-message: | ||
prefix: chore | ||
prefix-development: chore | ||
include: scope | ||
schedule: | ||
interval: daily | ||
|
||
- package-ecosystem: npm | ||
open-pull-requests-limit: 10 | ||
directory: / | ||
commit-message: | ||
prefix: build | ||
prefix-development: chore | ||
include: scope | ||
schedule: | ||
interval: daily | ||
|
||
- package-ecosystem: docker | ||
open-pull-requests-limit: 10 | ||
directory: / | ||
commit-message: | ||
prefix: build | ||
prefix-development: chore | ||
include: scope | ||
schedule: | ||
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,8 @@ | ||
# ----------------------------------------------------------- # | ||
# Note: this file originates in ahmadnassri/template-template # | ||
# ----------------------------------------------------------- # | ||
|
||
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,4 @@ | ||
{ | ||
"os": ["ubuntu-latest", "windows-latest", "macos-latest"], | ||
"node-version": [12, 14, 15] | ||
} |
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,13 +1,19 @@ | ||
# ----------------------------------------------------------- # | ||
# Note: this file originates in ahmadnassri/template-template # | ||
# ----------------------------------------------------------- # | ||
|
||
name: auto-merge | ||
|
||
on: | ||
pull_request: | ||
on: pull_request | ||
|
||
jobs: | ||
auto-merge: | ||
timeout-minutes: 5 | ||
|
||
runs-on: ubuntu-latest | ||
if: github.actor == 'dependabot[bot]' | ||
|
||
steps: | ||
- uses: ahmadnassri/[email protected] | ||
- 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,32 @@ | ||
# ----------------------------------------------------------- # | ||
# Note: this file originates in ahmadnassri/template-template # | ||
# ----------------------------------------------------------- # | ||
|
||
name: commit-lint | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
deduplicate: | ||
timeout-minutes: 5 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
# run on external PRs, but not on our internal PRs | ||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | ||
|
||
steps: | ||
- run: echo ::info ::de-duplicate ran successfully | ||
|
||
commit-lint: | ||
timeout-minutes: 5 | ||
|
||
needs: deduplicate | ||
|
||
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,54 @@ | ||
# ----------------------------------------------------------- # | ||
# Note: this file originates in ahmadnassri/template-template # | ||
# ----------------------------------------------------------- # | ||
|
||
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 | ||
--reference-links | ||
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,57 +1,61 @@ | ||
# ----------------------------------------------------------- # | ||
# Note: this file originates in ahmadnassri/template-node-lib # | ||
# ----------------------------------------------------------- # | ||
|
||
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 | ||
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 | ||
with: | ||
submodules: true | ||
|
||
- name: semantic-release | ||
uses: ahmadnassri/action-semantic-release@v1 | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: ahmadnassri/action-github-registry-npm-proxy@v1 | ||
with: | ||
github-token: ${{ secrets.GH_TOKEN }} | ||
owner: ${{ github.repository_owner }} | ||
|
||
- name: publish to github registry | ||
run: | | ||
jq '.name = "@'${GITHUB_REPOSITORY/node-/}'"' package.json > /tmp/package.json; mv /tmp/package.json . | ||
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,34 @@ | ||
# ----------------------------------------------------------- # | ||
# Note: this file originates in ahmadnassri/template-template # | ||
# ----------------------------------------------------------- # | ||
|
||
name: super-linter | ||
|
||
on: push | ||
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 ::info ::de-duplicate ran successfully | ||
|
||
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.15.1 | ||
env: | ||
LOG_LEVEL: ERROR | ||
VALIDATE_ALL_CODEBASE: false | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_TOKEN: ${{ github.token }} |
Oops, something went wrong.