Skip to content

Commit

Permalink
more ci configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
floticerus committed Mar 12, 2022
1 parent ec55f4b commit 40bd914
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 8 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ jobs:
- name: Fix git checkout line endings
run: git config --global core.autocrlf input
- uses: actions/[email protected]
with:
clean: false
- name: Use Node.js 17.x
uses: actions/[email protected]
with:
Expand All @@ -38,7 +36,7 @@ jobs:
- name: Install
run: yarn install
- name: Build
run: yarn build
run: yarn build:ci
- name: Zip
uses: papeloto/action-zip@v1
with:
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onlybuys-bot/main",
"version": "0.0.30",
"version": "0.0.31",
"description": "Multi-chain EVM compatible bot that buys new launches",
"engines": {
"node": ">= 16.13"
Expand All @@ -22,7 +22,8 @@
},
"scripts": {
"lint": "yarn workspace @onlybuys-bot/electron lint",
"build": "yarn workspace @onlybuys-bot/cli bundle && yarn && yarn workspace @onlybuys-bot/electron package"
"build": "yarn workspace @onlybuys-bot/cli bundle && yarn && yarn workspace @onlybuys-bot/electron package",
"build:ci": "yarn workspace @onlybuys-bot/cli bundle:ci && yarn && yarn workspace @onlybuys-bot/electron package"
},
"author": "Kevin <[email protected]>",
"license": "MIT",
Expand Down
4 changes: 3 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onlybuys-bot/cli",
"version": "0.0.30",
"version": "0.0.31",
"description": "EVM bot with new pair watcher and trading",
"engines": {
"node": ">= 16.13"
Expand Down Expand Up @@ -49,6 +49,8 @@
"start:moonriver": "yarn start -- --network=moonriver",
"start:moonbeam": "yarn start -- --network=moonbeam",
"bundle": "yarn webpack",
"bundle:ci": "yarn webpack -c ./webpack.ci.config.js",
"bundle:watch": "yarn webpack --watch",
"maybe-sell-all": "node build/src/maybe-sell-all.js",
"clean": "rimraf coverage build tmp",
"prebuild": "yarn lint",
Expand Down
33 changes: 33 additions & 0 deletions packages/cli/webpack.ci.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const path = require('path')
const webpack = require('webpack')
const nodeExternals = require('webpack-node-externals')

module.exports = {
entry: './src/main.ts',
devtool: 'inline-source-map',
mode: process.env.NODE_ENV === 'development' ? 'development' : 'production',
target: 'node',
externals: [nodeExternals()],
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: [/node_modules/, /__tests__/],
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'bundle-ci'),
},
plugins: [
new webpack.ProvidePlugin({
// Promise: 'es6-promise', // Thanks Aaron (https://gist.github.com/Couto/b29676dd1ab8714a818f#gistcomment-1584602)
// fetch: 'imports?this=>global!exports?global.fetch!node-fetch',
}),
],
}
5 changes: 4 additions & 1 deletion packages/electron/electron/cli-runner.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { join } from 'path'
import { EventEmitter } from 'events'
import { fork, ChildProcess } from 'child_process'
import { boolean as toBool } from 'boolean'
// import AbortController from 'abort-controller'
import store from './store'

Expand Down Expand Up @@ -98,7 +99,9 @@ export class CLIWrapper extends EventEmitter {
'node_modules',
'@onlybuys-bot',
'cli',
'bundle',
// this workaround is here because github actions insists on deleting
// everything that's in gitignore, but we can't add bundled files to git
toBool(process.env.GH_ACTIONS_CI) ? 'bundle-ci' : 'bundle',
'bundle',
),
[
Expand Down
2 changes: 1 addition & 1 deletion packages/electron/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@onlybuys-bot/electron",
"author": "Kevin <[email protected]>",
"version": "0.0.30",
"version": "0.0.31",
"description": "UI application for onlybuys-bot",
"main": "./.webpack/main",
"scripts": {
Expand Down

0 comments on commit 40bd914

Please sign in to comment.