Commit 909cbe23 authored by 神楽坂玲奈's avatar 神楽坂玲奈

ci

parent d2999c75
...@@ -2,18 +2,44 @@ variables: ...@@ -2,18 +2,44 @@ variables:
GIT_DEPTH: "1" GIT_DEPTH: "1"
stages: stages:
- prepare
- build - build
- deploy - deploy
macOS_bin:
stage: prepare
tags:
- linux
artifacts:
paths:
- bin
script:
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/mycard-mat/mycard-mat-macos.tar.gz | tar zxf -
windows_bin:
stage: prepare
tags:
- linux
artifacts:
paths:
- bin
script:
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/mycard-mat/mycard-mat-windows.tar.gz | tar zxf -
windows: windows:
image: chocolateyfest/node image: chocolateyfest/node
stage: build stage: build
dependencies:
- windows_bin
tags: tags:
- windows - windows
variables:
CSC_KEY_PASSWORD: $WINDOWS_CSC_KEY_PASSWORD
CSC_LINK: $WINDOWS_CSC_LINK
script: script:
- npm ci - npm ci
- npm run build - npm run build
- dir dist - npm run dist
artifacts: artifacts:
paths: paths:
- dist/mycard-* - dist/mycard-*
...@@ -26,7 +52,7 @@ linux: ...@@ -26,7 +52,7 @@ linux:
script: script:
- npm ci - npm ci
- npm run build - npm run build
- ls dist - npm run dist
artifacts: artifacts:
paths: paths:
- dist/mycard-* - dist/mycard-*
...@@ -35,10 +61,16 @@ macOS: ...@@ -35,10 +61,16 @@ macOS:
stage: build stage: build
tags: tags:
- macOS - macOS
variables:
CSC_KEY_PASSWORD: $MACOS_CSC_KEY_PASSWORD
CSC_LINK: $MACOS_CSC_LINK
APPLE_ID: $MACOS_NOTARIZE_USERNAME
APPLE_ID_PASSWORD: $MACOS_NOTARIZE_PASSWORD
TEAM_SHORT_NAME: $MACOS_ASC_PROVIDER
script: script:
- npm ci - npm ci
- npm run build - npm run build
- ls dist - npm run dist
artifacts: artifacts:
paths: paths:
- dist/mycard-* - dist/mycard-*
...@@ -46,12 +78,14 @@ macOS: ...@@ -46,12 +78,14 @@ macOS:
upload_to_minio: upload_to_minio:
stage: deploy stage: deploy
dependencies:
- macOS
- windows
- linux
tags: tags:
- linux - linux
image: python image: bitnami/aws-cli
script: script:
- pip install -U -i https://mirrors.aliyun.com/pypi/simple/ awscli
- aws s3 --endpoint=https://minio.mycard.moe:9000 sync dist/ s3://mycard/mycard-ci-test - aws s3 --endpoint=https://minio.mycard.moe:9000 sync dist/ s3://mycard/mycard-ci-test
only: # only:
- tags # - tags
- ci-test
...@@ -2,22 +2,16 @@ const raw = require('raw-socket'); ...@@ -2,22 +2,16 @@ const raw = require('raw-socket');
const socket = raw.createSocket({ protocol: raw.Protocol.UDP }); const socket = raw.createSocket({ protocol: raw.Protocol.UDP });
const handler = { const handler = {
connect(local_port, remote_port, remote_address) { connect(local_port, remote_port, remote_address) {
let buffer = Buffer.alloc(9); const buffer = Buffer.alloc(9);
buffer.writeUInt16BE(local_port, 0); buffer.writeUInt16BE(local_port, 0);
buffer.writeUInt16BE(remote_port, 2); buffer.writeUInt16BE(remote_port, 2);
buffer.writeUInt16BE(buffer.length, 4); buffer.writeUInt16BE(buffer.length, 4);
socket.send(buffer, 0, buffer.length, remote_address, (error, bytes) => { socket.send(buffer, 0, buffer.length, remote_address, () => {});
if (error) {
throw error;
}
});
}, },
}; };
process.on('message', (message) => { process.on('message', (message) => {
handler[message.action](...message.arguments); handler[message.action](...message.arguments);
}); });
process.on('disconnect', process.exit); process.on('disconnect', process.exit);
process.send('initialized'); process.send('initialized');
...@@ -79,6 +79,7 @@ ...@@ -79,6 +79,7 @@
"asar": false, "asar": false,
"files": [ "files": [
"main.js", "main.js",
"maotama.js",
"dist/mycard" "dist/mycard"
], ],
"extraResources": [ "extraResources": [
......
...@@ -34,7 +34,7 @@ let data_str = data_url.get('data'); ...@@ -34,7 +34,7 @@ let data_str = data_url.get('data');
// "arena_rank_ex":"335", // "arena_rank_ex":"335",
// } // }
let data = JSON.parse(data_str!); let data = JSON.parse(data_str);
let titleStr; let titleStr;
let icon = 'https://ygobbs.com/user_avatar/ygobbs.com/' + data.myname + '/120/1.png'; let icon = 'https://ygobbs.com/user_avatar/ygobbs.com/' + data.myname + '/120/1.png';
let myMame = data.myname; let myMame = data.myname;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment