Merge pull request '使用 DroneCI 自动构建' (#13) from ci/build-with-drone into master
Reviewed-on: https://git.unlock-music.dev/um/web/pulls/13remotes/origin/HEAD
commit
e2b81f666d
@ -0,0 +1,37 @@
|
|||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: default
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: node:16.18-bullseye
|
||||||
|
commands:
|
||||||
|
- apt-get update
|
||||||
|
- apt-get install -y cmake jq zip
|
||||||
|
- ./scripts/build-wasm.sh
|
||||||
|
- npm ci
|
||||||
|
- npm run test
|
||||||
|
- ./scripts/build-and-package.sh legacy
|
||||||
|
- ./scripts/build-and-package.sh extension
|
||||||
|
- ./scripts/build-and-package.sh modern
|
||||||
|
- sha256sum *.zip > sha256sum.txt
|
||||||
|
- mkdir -p upload
|
||||||
|
- mv *.zip sha256sum.txt upload/
|
||||||
|
|
||||||
|
- name: upload
|
||||||
|
image: "plugins/s3"
|
||||||
|
settings:
|
||||||
|
path_style: true
|
||||||
|
endpoint:
|
||||||
|
from_secret: S3_ENDPOINT
|
||||||
|
access_key:
|
||||||
|
from_secret: S3_ACCESS_KEY
|
||||||
|
secret_key:
|
||||||
|
from_secret: S3_SECRET_KEY
|
||||||
|
bucket:
|
||||||
|
from_secret: S3_BUCKET
|
||||||
|
region: "auto"
|
||||||
|
source: "upload/*"
|
||||||
|
strip_prefix: "upload/"
|
||||||
|
target: "${DRONE_REPO}/${DRONE_BUILD_NUMBER}/"
|
@ -1,8 +1,7 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
setupFilesAfterEnv: [
|
testPathIgnorePatterns: ['/build/', '/dist/', '/node_modules/'],
|
||||||
'./src/__test__/setup_jest.js'
|
setupFilesAfterEnv: ['./src/__test__/setup_jest.js'],
|
||||||
],
|
|
||||||
moduleNameMapper: {
|
moduleNameMapper: {
|
||||||
'@/(.*)': '<rootDir>/src/$1'
|
'@/(.*)': '<rootDir>/src/$1',
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
cd "$(git rev-parse --show-toplevel)"
|
||||||
|
|
||||||
|
VERSION="$(jq -r ".version" <package.json)"
|
||||||
|
DIST_NAME="um-web.$1.v${VERSION}"
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
"modern") npm run build -- --modern ;;
|
||||||
|
"legacy") npm run build ;;
|
||||||
|
"extension") npm run make-extension ;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "Unknown command: $1"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
mv dist "${DIST_NAME}"
|
||||||
|
zip -rJ9 "${DIST_NAME}.zip" "${DIST_NAME}"
|
||||||
|
|
||||||
|
if [ "$1" = "legacy" ]; then
|
||||||
|
# For upcoming extension build
|
||||||
|
mv "${DIST_NAME}" dist
|
||||||
|
else
|
||||||
|
rm -rf "${DIST_NAME}"
|
||||||
|
fi
|
@ -1,6 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -e
|
set -ex
|
||||||
|
|
||||||
|
cd "$(git rev-parse --show-toplevel)"
|
||||||
|
|
||||||
pushd ./src/QmcWasm
|
pushd ./src/QmcWasm
|
||||||
bash build-wasm
|
bash build-wasm
|
@ -1,20 +0,0 @@
|
|||||||
// import { DecryptBuffer as DecryptQmcCacheBuffer } from '../qmccache';
|
|
||||||
// import fs from 'fs';
|
|
||||||
//
|
|
||||||
// const expectedBuffer = fs.readFileSync(__dirname + '/fixture/qmc_cache_expected.bin');
|
|
||||||
//
|
|
||||||
// const createInputBuffer = () => {
|
|
||||||
// const buffer = Buffer.alloc(256);
|
|
||||||
// for (let i = buffer.byteLength; i >= 0; i--) {
|
|
||||||
// buffer[i] = i;
|
|
||||||
// }
|
|
||||||
// return buffer;
|
|
||||||
// };
|
|
||||||
//
|
|
||||||
// describe('decrypt/qmccache', () => {
|
|
||||||
// it('should decrypt specified buffer correctly', () => {
|
|
||||||
// const input = createInputBuffer();
|
|
||||||
// DecryptQmcCacheBuffer(input);
|
|
||||||
// expect(input).toEqual(expectedBuffer);
|
|
||||||
// });
|
|
||||||
// });
|
|
Loading…
Reference in New Issue