Skip to content

Commit

Permalink
ci: add ci config.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jun 15, 2024
1 parent 97c4d54 commit b10ad9a
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 18 deletions.
9 changes: 9 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# These are supported funding model platforms

# github: [jaywcjlove]
# patreon: # Replace with a single Patreon username
# open_collective: # Replace with a single Open Collective username
# ko_fi: # Replace with a single Ko-fi username
# tidelift: #npm/mocker-api
# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
custom: https://jaywcjlove.github.io/#/sponsor
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI
on:
push:
branches:
- master

jobs:
Build_Deploy:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'

- run: npm install
- run: npm run test:cov
- name: Create Tag
id: create_tag
uses: jaywcjlove/create-tag-action@main
with:
package-path: ./package.json

- name: 📝 Generate Changelog
id: changelog
uses: jaywcjlove/changelog-generator@main
with:
head-ref: ${{steps.create_tag.outputs.version}}
filter-author: (renovate-bot|dependabot|dependabot\[bot\]|Renovate Bot)
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'


- name: get tag version
id: tag_version
uses: jaywcjlove/changelog-generator@main


- name: ♻️ Create Release
uses: jaywcjlove/create-tag-action@main
with:
package-path: ./package.json
release: true
body: |
[![](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/@tsbb/copy-template-dir@${{steps.create_tag.outputs.versionNumber}}/file/README.md)
Documentation ${{ steps.changelog.outputs.tag }}: https://raw.githack.com/uiwjs/copy-template-dir/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html
Comparing Changes: ${{ steps.changelog.outputs.compareurl }}
${{ steps.changelog.outputs.changelog }}
- run: npm publish --access public --provenance
name: 📦 @tsbb/copy-template-dir publish to NPM
continue-on-error: true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
27 changes: 10 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
# copy-template-dir
[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][codecov-image]][codecov-url]
[![Downloads][downloads-image]][downloads-url]
[![js-standard-style][standard-image]][standard-url]
copy-template-dir
===

[![CI](https://github.com/tsbbjs/copy-template-dir/actions/workflows/ci.yml/badge.svg)](https://github.com/tsbbjs/copy-template-dir/actions/workflows/ci.yml)
[![npm version](https://img.shields.io/npm/v/@tsbb/copy-template-dir.svg)](https://www.npmjs.com/package/@tsbb/copy-template-dir)

High throughput template dir writes. Supports variable injection using the
mustache `{{ }}` syntax.

## Installation

```sh
$ npm install copy-template-dir
```

## Usage

```js
const copy = require('copy-template-dir')
const path = require('path')
Expand All @@ -30,7 +31,9 @@ copy(inDir, outDir, vars, (err, createdFiles) => {
```

## API

### copyTemplateDir(templateDir, targetDir, vars, cb)

Copy a directory of files over to the target directory, and inject the files
with variables. Takes the following arguments:
- __templateDir__: The directory that holds the templates. Filenames prepended
Expand All @@ -47,15 +50,5 @@ paths to created files if there were no errors.
- [maxstache-stream](https://github.com/yoshuawuyts/maxstache-stream)

## License
[MIT](https://tldrlegal.com/license/mit-license)

[npm-image]: https://img.shields.io/npm/v/copy-template-dir.svg?style=flat-square
[npm-url]: https://npmjs.org/package/copy-template-dir
[travis-image]: https://img.shields.io/travis/yoshuawuyts/copy-template-dir/master.svg?style=flat-square
[travis-url]: https://travis-ci.org/yoshuawuyts/copy-template-dir
[codecov-image]: https://img.shields.io/codecov/c/github/yoshuawuyts/copy-template-dir/master.svg?style=flat-square
[codecov-url]: https://codecov.io/github/yoshuawuyts/copy-template-dir
[downloads-image]: http://img.shields.io/npm/dm/copy-template-dir.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/copy-template-dir
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[standard-url]: https://github.com/feross/standard
[MIT](https://tldrlegal.com/license/mit-license)
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
"test": "npm run deps && NODE_ENV=test node test",
"test:cov": "npm run deps && NODE_ENV=test nyc tape test/index.js && nyc report --reporter=lcov"
},
"repository": "tsbbjs/copy-template-dir",
"repository": {
"type": "git",
"url": "https://github.com/tsbbjs/copy-template-dir.git"
},
"keywords": [
"template",
"directory",
Expand Down

0 comments on commit b10ad9a

Please sign in to comment.