Skip to content

Commit

Permalink
build npm by miniprogram-ci
Browse files Browse the repository at this point in the history
Signed-off-by: Kang HuaiShuai <khs1994@khs1994.com>
  • Loading branch information
khs1994 committed Mar 14, 2020
1 parent 02f2692 commit 5ebdaf4
Show file tree
Hide file tree
Showing 8 changed files with 124 additions and 103 deletions.
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ insert_final_newline = true
end_of_line = lf

charset=utf-8

trim_trailing_whitespace = true
26 changes: 15 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
- uses: actions/checkout@master
with:
fetch-depth: 1
- run: |
- name: init
run: |
set -x
echo $NODE_PATH
Expand All @@ -18,31 +19,34 @@ jobs:
which tsc && tsc -v
sudo npm -g i fs-extra
sudo npm -g i fs-extra miniprogram-ci
cd client && npm install && cd ..
npm run towxml:build
npm run gitbook:summary:generate
npm run gitbook:summary:towxml
- name: build ts
run: |
set -x
npm run tsc:pro
- name: build npm
run: |
set -x
cp project.config.json client/
echo 1111 > private.wxb830c3abf8a658a5.key
npm run npm:build
mkdir -p client/miniprogram_npm
cp -r client/node_modules/wx-markdown/markdown client/miniprogram_npm/wx-markdown
cp -r client/node_modules/wemark/wemark client/miniprogram_npm/
cp -r client/node_modules/towxml/dist/towxml client/miniprogram_npm/
name: init
- uses: docker://qqminiapp/build:latest
cp project.config.json client/
- uses: docker://qqminiapp/build:latest
env:
PLUGIN_VERSION: 0.0.1
PLUGIN_DESC: CI 自动构建上传
PLUGIN_APPTOKEN: ${{ secrets.APPTOKEN }}
PLUGIN_BUILDUSER: ${{ github.actor }}
PLUGIN_EXPERIENCE: true
PLUGIN_BUILDUSER: ${{ github.actor }}
PLUGIN_EXPERIENCE: true
#PLUGIN_FIRSTPAGE: pages/index/index
#PLUGIN_USEPACKAGEJSON: true
- run: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ client/buildcache
client/project.config.json

qrcode.png

private.*.key
4 changes: 2 additions & 2 deletions client/pages/docker/content/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"i-notice-bar": "/src/ui/iviewui/dist/notice-bar/index",
"i-button": "/src/ui/iviewui/dist/button/index",
"i-spin": "/src/ui/iviewui/dist/spin/index",
"markdown": "/wx-markdown/component/index",
"wemark": "/wemark/wemark"
"markdown": "wx-markdown/component/index",
"wemark": "wemark/wemark"
},
"enablePullDownRefresh": true,
"backgroundColor": "#36a1f0",
Expand Down
3 changes: 3 additions & 0 deletions client/pages/docker/summary/index.wxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<!-- 新版目录 目前使用中 -->
<view wx:if="{{isqq}}" style="margin-top:100px;">
</view>

<i-notice-bar icon="systemprompt" loop
speed="1200" backgroundcolor="#fff" color="#36a1f0" bind:tap="buyBook">
{{noticeMessage}}
Expand Down
60 changes: 35 additions & 25 deletions client/pages/index/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Jifen from '../../src/utils/Jifen';
import Cache from '../../src/Framework/src/Support/Cache';
import { getEndTime } from '../../src/utils/Qiandao';
import DB from '../../src/Framework/src/Support/DB';
import isqq from '../../src/utils/isqq';

const cache = new Cache();
const ad = new Ad();
Expand Down Expand Up @@ -59,23 +60,31 @@ Page({
cache.get('style/fontType'),
new Jifen().get(),
// @ts-ignore
wx.getSystemInfo().then(res => {
return Promise.resolve(res.SDKVersion);
}),
wx.cloud
.callFunction({
name: 'getDailySummary',
data: {},
})
.then(
res => {
return res.result;
},
e => {
console.log(e);
return 5701;
},
),
isqq
? () => {
return '0.0.1';
}
: wx.getSystemInfo().then(res => {
return Promise.resolve(res.SDKVersion);
}),
isqq
? () => {
return 1000;
}
: wx.cloud
.callFunction({
name: 'getDailySummary',
data: {},
})
.then(
res => {
return res.result;
},
e => {
console.log(e);
return 5701;
},
),
db
.collection('sign')
.where({
Expand Down Expand Up @@ -105,15 +114,16 @@ Page({
this.updateGitHubStatus(res[7] || false);
});

// @ts-ignore
wx.getStorageInfo().then((res: any) => {
this.setData!({
storageSize: ((res.currentSize / 1024) as any).toFixed(2) + ' MB',
// @ts-ignore
version: wx.getAccountInfoSync().miniProgram.version || 'dev',
if (!isqq) {
// @ts-ignore
wx.getStorageInfo().then((res: any) => {
this.setData!({
storageSize: ((res.currentSize / 1024) as any).toFixed(2) + ' MB',
// @ts-ignore
version: wx.getAccountInfoSync().miniProgram.version || 'dev',
});
});
});

}
wx.hideTabBarRedDot({
index: 1,
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"cloud:db:summary": "",
"cloud:db:news": "",
"towxml:build": "cd client && npm run towxml:build",
"npm:build": "",
"npm:build": "npx miniprogram-ci pack-npm --pp ./client --pkp ./private.wxb830c3abf8a658a5.key --appid wxb830c3abf8a658a5",
"tsc": "cd client && npm run compile",
"tsc:pro": "cd client && npm run compile:pro"
},
Expand Down
128 changes: 64 additions & 64 deletions project.config.json
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
{
"description": "docker_practice",
"packOptions": {
"ignore": []
},
"compileType": "miniprogram",
"libVersion": "2.10.3",
"projectname": "docker",
"miniprogramRoot": "client/",
"cloudfunctionRoot": "functions/",
"scripts": {
"beforeCompile": "npm run gitbook:summary:generate && cd client && npm run compile",
"beforePreview": "npm run gitbook:summary:generate && cd client && npm run compile:pro",
"beforeUpload": "npm run gitbook:summary:generate && cd client && npm run compile:pro"
},
"setting": {
"urlCheck": true,
"es6": true,
"enhance": true,
"postcss": true,
"minified": true,
"newFeature": true,
"nodeModules": true,
"autoAudits": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"bundle": true,
"remoteDebugLogEnable": false,
"scriptsEnable": true
},
"appid": "wxb830c3abf8a658a5",
"qqappid": "1110255921",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"cloudfunctionTemplateRoot": "cloudfunctionTemplate",
"qqLibVersion": "1.13.0",
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
}
}
"description": "docker_practice",
"packOptions": {
"ignore": []
},
"compileType": "miniprogram",
"libVersion": "2.10.3",
"projectname": "docker",
"miniprogramRoot": "client/",
"cloudfunctionRoot": "functions/",
"scripts": {
"beforeCompile": "npm run gitbook:summary:generate && cd client && npm run compile",
"beforePreview": "npm run gitbook:summary:generate && cd client && npm run compile:pro",
"beforeUpload": "npm run gitbook:summary:generate && cd client && npm run compile:pro"
},
"setting": {
"urlCheck": true,
"es6": true,
"enhance": true,
"postcss": false,
"minified": true,
"newFeature": true,
"nodeModules": true,
"autoAudits": true,
"uglifyFileName": true,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"bundle": true,
"remoteDebugLogEnable": false,
"scriptsEnable": true
},
"appid": "wxb830c3abf8a658a5",
"qqappid": "1110255921",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"cloudfunctionTemplateRoot": "cloudfunctionTemplate",
"qqLibVersion": "1.13.0",
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
}
}

0 comments on commit 5ebdaf4

Please sign in to comment.