-
-
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): sync with ahmadnassri/template-node-lib
- Loading branch information
Ahmad Nassri
committed
Oct 12, 2021
1 parent
99652e0
commit 048fbef
Showing
5 changed files
with
261 additions
and
13 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 |
---|---|---|
@@ -1 +1,5 @@ | ||
# ------------------------------------------------------------- # | ||
# Note: this file is automatically managed in template-template # | ||
# ------------------------------------------------------------- # | ||
|
||
github: [ahmadnassri] |
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,52 @@ | ||
# ------------------------------------------------------------- # | ||
# Note: this file is automatically managed in template-template # | ||
# ------------------------------------------------------------- # | ||
|
||
on: pull_request_target | ||
|
||
name: pull_request_target | ||
|
||
jobs: | ||
metadata: | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
repository: ${{ steps.metadata.outputs.repository }} | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- uses: ahmadnassri/action-metadata@v1 | ||
id: metadata | ||
|
||
auto-merge: | ||
timeout-minutes: 5 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
# only run for dependabot PRs | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
|
||
steps: | ||
- uses: ahmadnassri/[email protected] | ||
with: | ||
github-token: ${{ secrets.GH_TOKEN }} | ||
|
||
template-sync: | ||
needs: metadata | ||
|
||
timeout-minutes: 20 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
# only run for templates | ||
if: ${{ fromJSON(needs.metadata.outputs.repository).is_template }} | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
- uses: ahmadnassri/[email protected] | ||
- uses: ahmadnassri/[email protected] | ||
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,186 @@ | ||
# ------------------------------------------------------------- # | ||
# Note: this file is automatically managed in template-node-lib # | ||
# ------------------------------------------------------------- # | ||
|
||
on: | ||
- push | ||
- workflow_dispatch | ||
|
||
name: push | ||
|
||
jobs: | ||
metadata: | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
repository: ${{ steps.metadata.outputs.repository }} | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- uses: ahmadnassri/action-metadata@v1 | ||
id: metadata | ||
|
||
commit-lint: | ||
timeout-minutes: 5 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: ahmadnassri/action-commit-lint@v1 | ||
with: | ||
config: .github/linters/.commit-lint.yml | ||
|
||
super-linter: | ||
timeout-minutes: 5 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: github/super-linter/slim@v4 | ||
env: | ||
LOG_LEVEL: ERROR | ||
VALIDATE_ALL_CODEBASE: false | ||
FILTER_REGEX_EXCLUDE: '/github/workspace/README.md|test/fixtures/*' | ||
GITHUB_TOKEN: ${{ github.token }} | ||
|
||
npm-audit: | ||
timeout-minutes: 5 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/[email protected] | ||
|
||
- run: npm audit --audit-level=critical | ||
|
||
test-strategy: | ||
needs: | ||
- commit-lint | ||
- super-linter | ||
- npm-audit | ||
|
||
timeout-minutes: 5 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
matrix: ${{ steps.parse.outputs.matrix }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- id: parse | ||
run: echo "::set-output name=matrix::$(jq -c . < .github/matrix.json)" | ||
|
||
test-run: | ||
needs: test-strategy | ||
|
||
timeout-minutes: 5 | ||
|
||
name: ${{ matrix.name || format('node v{0} @ {1}', matrix.node-version, matrix.os) || 'test-step' }} | ||
|
||
strategy: | ||
matrix: ${{ fromJSON(needs.test-strategy.outputs.matrix) }} | ||
|
||
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: ${{ matrix.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} | ||
|
||
- run: npm ci | ||
- run: npm run test:ci | ||
|
||
release: | ||
needs: test-run | ||
|
||
# only runs on main branch | ||
if: ${{ github.ref == 'refs/heads/master' }} | ||
|
||
timeout-minutes: 20 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
published: ${{ steps.release.outputs.published }} | ||
version: ${{ steps.release.outputs.release-version }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- id: release | ||
uses: ahmadnassri/action-semantic-release@v1 | ||
with: | ||
config: ${{ github.workspace }}/.semantic.json | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
|
||
mirror: | ||
needs: release | ||
|
||
timeout-minutes: 5 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
if: ${{ needs.release.outputs.published == 'true' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- uses: ahmadnassri/action-github-registry-npm-proxy@v2 | ||
with: | ||
token: ${{ secrets.GH_TOKEN }} | ||
scope: ${{ 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 | ||
template-sync: | ||
timeout-minutes: 20 | ||
|
||
needs: | ||
- metadata | ||
- test-run | ||
- commit-lint | ||
- super-linter | ||
|
||
# only runs on main branch and only for the template | ||
if: ${{ github.ref == 'refs/heads/master' && fromJSON(needs.metadata.outputs.repository).is_template }} | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: ahmadnassri/[email protected] | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- uses: ahmadnassri/[email protected] | ||
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,11 @@ | ||
input-file: docs/README.md | ||
output-file: README.md | ||
metadata-file: colophon.yml | ||
template: docs/README.template | ||
|
||
from: gfm | ||
to: gfm | ||
|
||
wrap: preserve | ||
reference-links: true | ||
fail-if-warnings: false |
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