Skip to content

Commit

Permalink
Merge pull request #2 from TakahiroHimi/TakahiroHimi/chore/setting-gi…
Browse files Browse the repository at this point in the history
…thub-actions

chore: setting-github-actions
  • Loading branch information
TakahiroHimi committed Oct 18, 2021
2 parents 284f685 + 6ccffae commit 58f0aa3
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 2 deletions.
51 changes: 51 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name-template: "v$RESOLVED_VERSION 🌈"
tag-template: "v$RESOLVED_VERSION"
exclude-labels:
- "release"
- "auto"
autolabeler:
- label: "docs"
files:
- "*.md"
branch:
- '/docs{0,1}\/.+/'
- label: "bug"
branch:
- '/fix\/.+/'
title:
- "/fix/i"
- label: "enhancement"
branch:
- '/feature\/.+/'
categories:
- title: "🚀 Features"
labels:
- "feature"
- "enhancement"
- title: "🐛 Bug Fixes"
labels:
- "fix"
- "bugfix"
- "bug"
- title: "📖 Docs"
labels:
- "docs"
- title: "🧰 Maintenance"
label: "chore"
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"
patch:
labels:
- "patch"
default: patch
template: |
## Changes
$CHANGES
38 changes: 38 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release

on:
push:
branches:
- main
tags:
- "release"

jobs:
npm:
name: Publish package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14"
registry-url: "https://registry.npmjs.org/"
- name: Prepare
run: |
yarn --frozen-lockfile
yarn build
- name: Set released version to env
run: node -p -e '`RELEASED_PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV
- name: Create release draft on GitHub
uses: release-drafter/release-drafter@v5
with:
version: ${{ env.RELEASED_PACKAGE_VERSION }}
name: ${{ env.RELEASED_PACKAGE_VERSION }}
tag: ${{ env.RELEASED_PACKAGE_VERSION }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: test

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- run: yarn --frozen-lockfile
- run: yarn run build
- run: yarn run test
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
"scripts": {
"test": "jest",
"build": "tsc",
"lint": "eslint --fix 'src/**/*.ts'",
"prepublishOnly": "yarn build"
"lint": "eslint --fix 'src/**/*.ts'"
},
"jest": {
"moduleFileExtensions": [
Expand Down

0 comments on commit 58f0aa3

Please sign in to comment.