Skip to content

Commit

Permalink
Merge pull request #30 from elmarti/update-cd
Browse files Browse the repository at this point in the history
Update cd
  • Loading branch information
elmarti authored Jan 7, 2022
2 parents 58a1bd7 + ecdd582 commit 60b6c3e
Show file tree
Hide file tree
Showing 12 changed files with 8,288 additions and 5,447 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release
on:
push:
branches:
- master
jobs:
# dx-scanner:
# runs-on: ubuntu-latest
# container: dxheroes/dx-scanner:latest
# steps:
# - uses: actions/checkout@v1
# - name: Runs DX Scanner on the code
# env:
# GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
# DXSCANNER_API_TOKEN: ${{ secrets.DXSCANNER_API_TOKEN }}
# run: dx-scanner run --ci
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Set vars
id: vars
run: echo ::set-output name=branch_name::${GITHUB_REF#refs/*/}
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 'lts/*'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build project
run: yarn build
- name: Semantic Release
id: semantic
uses: cycjimmy/semantic-release-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Deploy storybook to Github Pages
run: npm run deploy-storybook -- --ci
env:
GH_TOKEN: MyCompany:${{ secrets.GITHUB_TOKEN }}


2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.idea
node_modules
build
.cache
yarn-error.log
53 changes: 53 additions & 0 deletions .releaserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@


const path = require('path');
const fs = require('fs');
// Given a `const` variable `TEMPLATE_DIR` which points to "<semantic-release-gitmoji>/lib/assets/templates"

// the *.hbs template and partials should be passed as strings of contents
const template = fs.readFileSync(path.join('semantic-release-templates', 'default-template.hbs'))
const commitTemplate = fs.readFileSync(path.join('semantic-release-templates', 'commit-template.hbs'))

module.exports = {
branches: ["master"],
plugins: [
[
'semantic-release-gitmoji', {
releaseRules: {
major: [ ':boom:' ],
minor: [ ':sparkles:', ':sparkle' ],
patch: [
':bug:',
':ambulance:',
':lock:'
]
},
releaseNotes: {
template,
partials: { commitTemplate },
helpers: {
datetime: function () {
const date = new Date();
return date.toLocaleString('en-US', {
weekday: 'short',
month: 'long',
day: '2-digit',
year: 'numeric'
});
}
},
issueResolution: {
template: '{baseUrl}/{owner}/{repo}/issues/{ref}',
baseUrl: 'https://github.com',
source: 'github.com'
}
}
}
],
'@semantic-release/github',
'@semantic-release/npm'
],
tagFormat: '${version}',


}
1 change: 0 additions & 1 deletion .storybook/addons.js

This file was deleted.

19 changes: 0 additions & 19 deletions .storybook/config.js

This file was deleted.

13 changes: 13 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
"stories": [
"../src/**/*.stories.mdx",
"../src/**/*.stories.@(js|jsx|ts|tsx)"
],
"addons": [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-actions"

],
"framework": "@storybook/react"
}
9 changes: 9 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
}
11 changes: 0 additions & 11 deletions .storybook/webpack.config.js

This file was deleted.

38 changes: 21 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,36 @@
"scripts": {
"storybook": "start-storybook -p 6006 -c .storybook",
"build": "tsc",
"prepublish": "npm run build",
"prepublish": "yarn build",
"deploy-storybook": "storybook-to-ghpages"
},
"repository": "https://github.com/elmarti/react-joystick-component",
"author": "elmarti [email protected]",
"license": "MIT",
"devDependencies": {
"@storybook/addon-actions": "4.1.0-alpha.1",
"@storybook/react": "4.1.0-alpha.1",
"@storybook/storybook-deployer": "^2.3.0",
"@types/jest": "^22.2.2",
"@types/react": "^16.4.13",
"@types/storybook__addon-actions": "^3.4.1",
"@types/storybook__react": "^3.0.9",
"awesome-typescript-loader": "^4.0.1",
"@storybook/addon-actions": "^6.4.9",
"@storybook/addon-essentials": "^6.4.9",
"@storybook/addon-links": "^6.4.9",
"@storybook/react": "^6.4.9",
"@storybook/storybook-deployer": "^2.8.10",
"@types/jest": "^27.4.0",
"@types/react": "17.0.38",
"@types/storybook__addon-actions": "^5.2.1",
"awesome-typescript-loader": "^5.2.1",
"babel-core": "^6.26.0",
"babel-loader": "7",
"babel-loader": "8.2.3",
"cpx": "^1.5.0",
"jest": "^22.4.3",
"jest": "^27.4.7",
"react": "17.0.2",
"react-docgen-typescript-webpack-plugin": "^1.1.0",
"storybook-addon-jsx": "^5.3.0",
"ts-jest": "^22.4.2",
"typescript": "^2.8.1"
"react-dom": "17.0.2",
"semantic-release-gitmoji": "^1.4.2",
"storybook-addon-jsx": "^7.3.14",
"ts-jest": "^27.1.2",
"typescript": "4.5.4"
},
"dependencies": {
"react": "^16.5.0",
"react-dom": "^16.5.0"
"peerDependencies": {
"react": "17.0.2",
"react-dom": "17.0.2"
}
}
4 changes: 4 additions & 0 deletions semantic-release-templates/commit-template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[`{{commit.short}}`](https://github.com/{{owner}}/{{repo}}/commit/{{commit.short}}) {{subject}} - {{message}} {{#if issues}}(Issues:{{#each issues}} [`{{text}}`]({{link}}){{/each}}){{/if}}{{#if wip}}{{#each wip}}
- [`{{commit.short}}`](https://github.com/{{owner}}/{{repo}}/commit/{{commit.short}}) {{subject}}{{/each}}

{{/if}}
42 changes: 42 additions & 0 deletions semantic-release-templates/default-template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{{#if compareUrl}}
# [v{{nextRelease.version}}]({{compareUrl}}) ({{datetime "UTC:yyyy-mm-dd"}})
{{else}}
# v{{nextRelease.version}} ({{datetime "UTC:yyyy-mm-dd"}})
{{/if}}

{{#with commits}}
{{#if sparkles}}
## ✨ New Features
{{#each sparkles}}
- {{> commitTemplate}}
{{/each}}
{{/if}}

{{#if bug}}
## 🐛 Bug Fixes
{{#each bug}}
- {{> commitTemplate}}
{{/each}}
{{/if}}

{{#if ambulance}}
## 🚑 Critical Hotfixes
{{#each ambulance}}
- {{> commitTemplate}}
{{/each}}
{{/if}}

{{#if lock}}
## 🔒 Security Issues
{{#each lock}}
- {{> commitTemplate}}
{{/each}}
{{/if}}

{{#if boom}}
## 💥 Breaking Changes
{{#each boom}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{/with}}
Loading

0 comments on commit 60b6c3e

Please sign in to comment.