Skip to content

Commit

Permalink
chore(template): sync with ahmadnassri/template-node-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad Nassri committed Oct 12, 2021
1 parent 0b38330 commit 029cd44
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 33 deletions.
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# ------------------------------------------------------------- #
# Note: this file is automatically managed in template-template #
# ------------------------------------------------------------- #

github: [ahmadnassri]
1 change: 0 additions & 1 deletion .github/workflows/pull_request_target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,5 @@ jobs:
ref: ${{ github.event.pull_request.head.ref }}
- uses: ahmadnassri/[email protected]
- uses: ahmadnassri/[email protected]
- uses: ahmadnassri/[email protected]
with:
github-token: ${{ secrets.GH_TOKEN }}
42 changes: 23 additions & 19 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# Note: this file is automatically managed in template-node-lib #
# ------------------------------------------------------------- #

on: push
on:
- push
- workflow_dispatch

name: push

Expand Down Expand Up @@ -41,7 +43,7 @@ jobs:
with:
fetch-depth: 0

- uses: github/super-linter@v4.0.2
- uses: github/super-linter/slim@v4
env:
LOG_LEVEL: ERROR
VALIDATE_ALL_CODEBASE: false
Expand All @@ -61,6 +63,11 @@ jobs:
- run: npm audit --audit-level=critical

test-strategy:
needs:
- commit-lint
- super-linter
- npm-audit

timeout-minutes: 5

runs-on: ubuntu-latest
Expand All @@ -74,11 +81,7 @@ jobs:
run: echo "::set-output name=matrix::$(jq -c . < .github/matrix.json)"

test-run:
needs:
- commit-lint
- super-linter
- npm-audit
- test-strategy
needs: test-strategy

timeout-minutes: 5

Expand All @@ -98,7 +101,7 @@ jobs:
with:
submodules: true

- uses: actions/[email protected].6
- uses: actions/[email protected].5
with:
path: ~/.npm
key: ${{ matrix.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
Expand All @@ -123,7 +126,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN }}
submodules: true

- id: release
uses: ahmadnassri/action-semantic-release@v1
Expand All @@ -140,7 +143,7 @@ jobs:

runs-on: ubuntu-latest

if: needs.release.outputs.published == 'true'
if: ${{ needs.release.outputs.published == 'true' }}

steps:
- uses: actions/checkout@v2
Expand All @@ -154,29 +157,30 @@ jobs:

- name: publish to github registry
run: |
jq '.name = "@'${GITHUB_REPOSITORY/node-/}'"' package.json > /tmp/package.json; mv /tmp/package.json .
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
- release

timeout-minutes: 20
- 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 }}
if: ${{ github.ref == 'refs/heads/master' && fromJSON(needs.metadata.outputs.repository).is_template }}

runs-on: ubuntu-latest

steps:
- uses: ahmadnassri/action-workflow-queue@v1
- uses: ahmadnassri/action-workflow-queue@v1.1

- uses: actions/checkout@v2

- uses: ahmadnassri/action-template-repository-sync@v1
- uses: ahmadnassri/action-template-repository-sync@v1.6.0
with:
github-token: ${{ secrets.GH_TOKEN }}
dry-run: true
11 changes: 11 additions & 0 deletions .pandoc.yml
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
21 changes: 8 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,25 @@ x-node: &node
services:
# ---- super-linter ---- #
lint:
image: github/super-linter:v3
image: github/super-linter:slim-v4
volumes:
- ./:/tmp/lint
- ./:/github/workspace
environment:
RUN_LOCAL: 'true'
LOG_LEVEL: 'ERROR'
MULTI_STATUS: 'false'
IGNORE_GITIGNORED_FILES: 'true'
DEFAULT_WORKSPACE: /github/workspace
FILTER_REGEX_EXCLUDE: '/github/workspace/README.md|test/fixtures/*'

# ---- readme generator ---- #
readme:
image: pandoc/core:2.11.4
image: pandoc/core:2.13
volumes:
- ./:/data
command: >-
--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
command: --defaults=.pandoc.yml

# ---- test runner ---- #
test:
<<: *node
image: node:alpine
Expand Down

0 comments on commit 029cd44

Please sign in to comment.