Skip to content

Commit

Permalink
Merge pull request #26 from d4data-official/dev
Browse files Browse the repository at this point in the history
CI/CD dev/master merge
  • Loading branch information
jess-sys authored May 13, 2021
2 parents cea8d93 + 3f516e9 commit 28ac985
Show file tree
Hide file tree
Showing 90 changed files with 13,110 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.eslintrc.js
app
dist
8 changes: 8 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
extends: ['eslint-config-airbnb'],
rules: {
'semi': 'off',
'max-len': ['error', { 'code': 120 }],
'template-curly-spacing': ['error', 'always'],
},
}
26 changes: 26 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build binaries

on: [push]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: ['15.x']
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install Yarn
run: npm install -g yarn

- run: yarn install
name: Install dependencies

- run: yarn build
name: Build
36 changes: 36 additions & 0 deletions .github/workflows/dependent-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Dependent PR/Issues

on:
issues:
types:
- opened
- edited
- reopened
pull_request_target:
types:
- opened
- edited
- reopened
- synchronize
schedule:
- cron: '0 0 * * *' # schedule daily check

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: z0al/dependent-issues@v1
env:
# (Required) The token to use to make API calls to GitHub.
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
# (Optional) The label to use to mark dependent issues
label: dependent

# (Optional) Enable checking for dependencies in issues. Enable by
# setting the value to "on". Default "off"
check_issues: off

# (Optional) A comma-separated list of keywords. Default
# "depends on, blocked by"
keywords: depends on, blocked by
28 changes: 28 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Linter

on:
push:
branches: [ dev ]
pull_request:
branches: [ dev ]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [ 14.x ]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- run: npm install
name: Install dependencies

- run: npm run lint
name: Run linter
90 changes: 90 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Build binaries for Linux/Windows/MacOS

on:
push:
branches: [ master ]

jobs:
create_release:
name: Create release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
package_version: ${{ steps.package_version.outputs.current-version }}
steps:
- uses: actions/checkout@v2
name: Clone Repo

- name: Retrieve package.json version
id: package_version
uses: martinbeentjes/npm-get-version-action@master

- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: v${{ steps.package_version.outputs.current-version }}
release_name: Release v${{ steps.package_version.outputs.current-version }}

build_release:
name: Build release for ${{ matrix.os }}
needs: create_release
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [15.x]
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
binary_name: d4data-${{ needs.create_release.outputs.package_version}}.AppImage
- os: macos-latest
binary_name: d4data-${{ needs.create_release.outputs.package_version}}.dmg
- os: windows-latest
binary_name: "d4data Setup ${{ needs.create_release.outputs.package_version}}.exe"
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v2
name: Clone repo

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: Install dependencies
run: npm install

- name: Build binaries
run: npm runbuild
env:
GH_TOKEN: "${{ secrets.GH_TOKEN }}"

- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.binary_name }}
path: dist_electron/${{ matrix.binary_name }}

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: dist_electron/${{ matrix.binary_name }}
asset_name: ${{ matrix.binary_name }}
asset_content_type: application/octet-stream
12 changes: 12 additions & 0 deletions .github/workflows/wip_pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: WIP PR
on:
pull_request:
types: [opened, synchronize, reopened, edited]

jobs:
wip:
runs-on: ubuntu-latest
steps:
- uses: wip/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
*.log
.next
app
dist
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint:fix
40 changes: 40 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Nextron: Main",
"type": "node",
"request": "attach",
"protocol": "inspector",
"port": 9292,
"skipFiles": ["<node_internals>/**"],
"sourceMapPathOverrides": {
"webpack:///./~/*": "${workspaceFolder}/node_modules/*",
"webpack:///./*": "${workspaceFolder}/*",
"webpack:///*": "*"
}
},
{
"name": "Nextron: Renderer",
"type": "pwa-chrome",
"request": "attach",
"port": 5858,
"timeout": 10000,
"urlFilter": "http://localhost:*",
"webRoot": "${workspaceFolder}/app",
"sourceMapPathOverrides": {
"webpack:///./src/*": "${webRoot}/*"
}
}
],
"compounds": [
{
"name": "Nextron: All",
"preLaunchTask": "dev",
"configurations": ["Nextron: Main", "Nextron: Renderer"]
}
]
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": true,
}
}
21 changes: 21 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "dev",
"isBackground": true,
"problemMatcher": {
"owner": "custom",
"pattern": {
"regexp": ""
},
"background": {
"beginsPattern": "started server",
"endsPattern": "Debugger listening on"
}
},
"label": "dev",
}
],
}
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
# d4data-app
<p align="center"><img src="https://i.imgur.com/flcMvDC.png"></p>

## Usage

### Install Dependencies

```
# using yarn or npm
$ yarn (or `npm install`)
# using pnpm
$ pnpm install --shamefully-hoist
```

### Use it

```
# development mode
$ yarn dev (or `npm run dev` or `pnpm run dev`)
# production build
$ yarn build (or `npm run build` or `pnpm run build`)
```
5 changes: 5 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Security Policy

## Reporting a Vulnerability

Please open an issue or join our Discord server.
31 changes: 31 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const types = [
'build',
'ci',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'style',
'test',
]

module.exports = {
rules: {
'body-leading-blank': [1, 'always'],
'footer-leading-blank': [1, 'always'],
'header-max-length': [1, 'always', 72],
'scope-case': [1, 'always', 'lower-case'],
'subject-case': [
1,
'never',
['sentence-case', 'start-case', 'pascal-case', 'upper-case'],
],
'subject-empty': [1, 'never'],
'subject-full-stop': [1, 'never', '.'],
'type-case': [1, 'always', 'lower-case'],
'type-empty': [1, 'never'],
'type-enum': [1, 'always', types],
},
}
Loading

0 comments on commit 28ac985

Please sign in to comment.