Skip to content

Commit

Permalink
Merge pull request #9 from aspida/ci
Browse files Browse the repository at this point in the history
ci: setup
  • Loading branch information
LumaKernel authored Mar 23, 2022
2 parents cae151f + e15f276 commit b4bae3d
Show file tree
Hide file tree
Showing 8 changed files with 216 additions and 17 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "monthly"
versioning-strategy: "increase"
commit-message:
prefix: "chore"
prefix-development: "chore"
include: "scope"
28 changes: 28 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
Thank you for your contribution! 👍
-->

## Types of changes

- [ ] Bug fixes
- resolves #<!-- Please add issue number -->
- [ ] Features
- resolves #<!-- Please add issue number -->
- [ ] Maintenance
- [ ] Documentation

## Changes

- ...


## Additional context


## Community note

<!-- Please keep this section. -->

Please upvote with reacting as :+1: to express your agreement.
71 changes: 71 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name-template: 'v$RESOLVED_VERSION 🌈'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: '🚀 Features'
labels:
- 'feature'
- title: '🐛 Bug Fixes'
labels:
- 'bug'
- title: '🧰 Maintenance'
label: 'chore'
- title: '📚 Documentation'
label: 'documentation'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
- 'feature'
patch:
labels:
- 'patch'
- 'fix'
- 'chore'
- 'documentation'
default: patch
template: |
## Changes
$CHANGES
autolabeler:
- label: 'chore'
files:
- '*.md'
branch:
- '/chore\b/'
title:
- '/\bchore\b/i'
body:
- '/^- \[x\] Maintenance/m'
- label: 'documentation'
files:
- '*.md'
branch:
- '/docs?\b/'
title:
- '/\bdocs\b/i'
body:
- '/^- \[x\] Documentation/m'
- label: 'bug'
branch:
- '/fix\b/'
- '/bug\b/'
title:
- '/\bfix\b/i'
- '/\bbug\b/i'
body:
- '/^- \[x\] Bug fixes/m'
- label: 'feature'
branch:
- '/feature\b/'
- '/feat\b.+/'
title:
- '/\bfeature\b/'
- '/\bfeat\b/'
body:
- '/^- \[x\] Features/m'
56 changes: 56 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Node.js CI

on: [push, pull_request]

jobs:
test:
name: "Test on Node:${{ matrix.node-version }} OS:${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [12, 14, 16]
os: [ubuntu-latest]
include:
- os: windows-latest
node-version: 14
steps:
- uses: actions/checkout@v2
- name: setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v2
id: yarn-cache
with:
path: "node_modules"
key: ${{ runner.os }}-node-v${{ matrix.node-version }}-yarn-${{ hashFiles('yarn.lock') }}
- run: yarn --frozen-lockfile
if: steps.yarn-cache.outputs.cache-hit != 'true'
- run: yarn typecheck
- run: yarn test

release:
runs-on: ubuntu-latest
needs: test
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 14
registry-url: "https://registry.npmjs.org"
- uses: actions/cache@v2
id: yarn-cache
with:
path: "node_modules"
key: ${{ runner.os }}-node-v12-yarn-${{ hashFiles('yarn.lock') }}
- run: yarn --frozen-lockfile
if: steps.yarn-cache.outputs.cache-hit != 'true'
- run: |
VERSION="$(node -e 'console.log(process.argv[1].match(/^refs\/tags\/v(\d+\.\d+\.\d+)$/)[1])' "${{ github.ref }}")"
node -e 'console.log(JSON.stringify({...require("./package.json"),version:process.argv[1]}, null, 2))' "$VERSION" | tee ./tmp-package.json
mv ./tmp-package.json ./package.json
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/release-drafter-auto-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Release Drafter

on:
pull_request_target:
branches:
- main
types: [opened, reopened, synchronize]

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
disable-releaser: true
disable-autolabeler: false
17 changes: 17 additions & 0 deletions .github/workflows/release-drafter-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Release Drafter

on:
push:
branches:
- main

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
with:
disable-releaser: false
disable-autolabeler: true
14 changes: 6 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,28 @@
"eslintplugin",
"eslint-plugin"
],
"author": "ibuki2003",
"author": "frourio inc",
"main": "dist/index.js",
"scripts": {
"test": "ts-mocha 'tests/**/*.ts' --paths",
"typecheck": "tsc --noEmit",
"build": "tsc --build tsconfig.build.json",
"prepublishOnly": "yarn build"
},
"dependencies": {
"devDependencies": {
"@types/eslint": "^7.2.0",
"@types/node": "^14.0.14",
"@typescript-eslint/experimental-utils": "^3.5.0",
"typescript": "^3.9.6"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^3.5.0",
"@typescript-eslint/experimental-utils": "^3.5.0",
"@typescript-eslint/parser": "^3.5.0",
"eslint": "^7.3.1",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.4",
"mocha": "^7.2.0",
"prettier": "^2.0.5",
"tsc": "^1.20150623.0",
"ts-mocha": "^7.0.0",
"ts-node": "^8.10.2"
"ts-node": "^8.10.2",
"typescript": "^4.6.2"
},
"engines": {
"node": ">=0.10.0"
Expand Down
13 changes: 4 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1303,11 +1303,6 @@ ts-node@^8.10.2:
source-map-support "^0.5.17"
yn "3.1.1"

tsc@^1.20150623.0:
version "1.20150623.0"
resolved "https://registry.yarnpkg.com/tsc/-/tsc-1.20150623.0.tgz#4ebc3c774e169148cbc768a7342533f082c7a6e5"
integrity sha1-Trw8d04WkUjLx2inNCUz8ILHpuU=

tsconfig-paths@^3.5.0:
version "3.9.0"
resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz#098547a6c4448807e8fcb8eae081064ee9a3c90b"
Expand Down Expand Up @@ -1342,10 +1337,10 @@ type-fest@^0.8.1:
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d"
integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==

typescript@^3.9.6:
version "3.9.6"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.6.tgz#8f3e0198a34c3ae17091b35571d3afd31999365a"
integrity sha512-Pspx3oKAPJtjNwE92YS05HQoY7z2SFyOpHo9MqJor3BXAGNaPUs83CuVp9VISFkSjyRfiTpmKuAYGJB7S7hOxw==
typescript@^4.6.2:
version "4.6.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.2.tgz#fe12d2727b708f4eef40f51598b3398baa9611d4"
integrity sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==

uri-js@^4.2.2:
version "4.2.2"
Expand Down

0 comments on commit b4bae3d

Please sign in to comment.