Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
yjcyxky committed Mar 5, 2024
2 parents 7a46208 + 9711035 commit 44aa545
Show file tree
Hide file tree
Showing 124 changed files with 25,773 additions and 59 deletions.
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
about: Manage your project's issue templates
config:
blank_issues_enabled: false
contact_links:
- name: OpenProphetDB Team
url: https://www.prophetdb.org/contact/
about: Please ask and answer questions here.
issue_templates:
- name: Bug report
about: Create a report to help us improve
labels: bug
assignees: yjcyxky@163.com
- name: Feature request
about: Suggest an idea for this project
labels: enhancement
assignees: yjcyxky@163.com
84 changes: 56 additions & 28 deletions .github/workflows/publish-bin.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,60 @@
name: Build and Release Binaries

on:
push:
branches:
- dev
workflow_dispatch:

jobs:
build:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
include:
- os: macos-latest
arch: [amd64, arm64]
- os: ubuntu-latest
arch: [amd64, arm64]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Determine tag or commit for release name
id: release_name
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
else
echo "::set-output name=tag::$(git rev-parse --short HEAD)"
fi
shell: bash

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16.13.1'

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
node-version: '16.20.2'

- name: Build project
- name: Build frontend
run: |
printf "Building studio based on openapi...\n"
mkdir -p assets
cd studio && yarn && yarn openapi || true
cd studio && yarn build:embed && cd ..
cargo build --release
git submodule update --init --recursive
cd studio && yarn --ignore-engines && yarn openapi || true
yarn build:embed
- name: Build with messense/rust-musl-cross
run: |
docker run --rm -v "${{ github.workspace }}:/home/rust/src" messense/rust-musl-cross:x86_64-musl cargo build --release --target x86_64-unknown-linux-musl
find ./target -type f -name "biomedgps*" -exec ls -l {} \;
- name: Build with messense/rust-musl-cross
run: |
docker run --rm -v "${{ github.workspace }}:/home/rust/src" messense/rust-musl-cross:aarch64-musl cargo build --release --target aarch64-unknown-linux-musl
find ./target -type f -name "biomedgps*" -exec ls -l {} \;
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
tag_name: ${{ steps.release_name.outputs.tag }}
release_name: Release ${{ steps.release_name.outputs.tag }}
draft: ${{ github.event_name != 'workflow_dispatch' }}
prerelease: false

- name: Upload Release Asset (biomedgps)
Expand All @@ -55,8 +63,28 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/release/biomedgps-${{ matrix.os }}-${{ matrix.arch }}
asset_name: biomedgps-${{ matrix.os }}-${{ matrix.arch }}
asset_path: ./target/x86_64-unknown-linux-musl/release/biomedgps
asset_name: biomedgps-x86_64-unknown-linux-musl
asset_content_type: application/octet-stream

- name: Upload Release Asset (biomedgps-cli)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/x86_64-unknown-linux-musl/release/biomedgps-cli
asset_name: biomedgps-cli-x86_64-unknown-linux-musl
asset_content_type: application/octet-stream

- name: Upload Release Asset (biomedgps)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/aarch64-unknown-linux-musl/release/biomedgps
asset_name: biomedgps-aarch64-unknown-linux-musl
asset_content_type: application/octet-stream

- name: Upload Release Asset (biomedgps-cli)
Expand All @@ -65,6 +93,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/release/biomedgps-cli-${{ matrix.os }}-${{ matrix.arch }}
asset_name: biomedgps-cli-${{ matrix.os }}-${{ matrix.arch }}
asset_path: ./target/aarch64-unknown-linux-musl/release/biomedgps-cli
asset_name: biomedgps-cli-aarch64-unknown-linux-musl
asset_content_type: application/octet-stream
26 changes: 0 additions & 26 deletions .github/workflows/publish-docker-image.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RUN wget -O miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-L
bash miniconda.sh -b -p /opt/miniconda && \
rm miniconda.sh
RUN conda create -n biomedgps nodejs=16.13.1
RUN npm install -g yarn
RUN npm install -g yarn@1.22.19

# Add the rest of the source
ADD . .
Expand Down
1 change: 0 additions & 1 deletion studio
Submodule studio deleted from 8fdc71
3 changes: 3 additions & 0 deletions studio/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: require.resolve('@umijs/max/eslint'),
};
13 changes: 13 additions & 0 deletions studio/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/node_modules
/.env.local
/.umirc.local.ts
/config/config.local.ts
/src/.umi
/src/.umi-production
/src/.umi-test
/.umi
/.umi-production
/.umi-test
/dist
/.mfsu
.swc
17 changes: 17 additions & 0 deletions studio/.lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"*.{md,json}": [
"prettier --cache --write"
],
"*.{js,jsx}": [
"max lint --fix --eslint-only",
"prettier --cache --write"
],
"*.{css,less}": [
"max lint --fix --stylelint-only",
"prettier --cache --write"
],
"*.ts?(x)": [
"max lint --fix --eslint-only",
"prettier --cache --parser=typescript --write"
]
}
2 changes: 2 additions & 0 deletions studio/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
registry=https://registry.npmjs.com/

3 changes: 3 additions & 0 deletions studio/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
.umi
.umi-production
8 changes: 8 additions & 0 deletions studio/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"printWidth": 80,
"singleQuote": true,
"trailingComma": "all",
"proseWrap": "never",
"overrides": [{ "files": ".prettierrc", "options": { "parser": "json" } }],
"plugins": ["prettier-plugin-organize-imports", "prettier-plugin-packagejson"]
}
3 changes: 3 additions & 0 deletions studio/.stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: require.resolve('@umijs/max/stylelint'),
};
3 changes: 3 additions & 0 deletions studio/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# README

`@umijs/max` 模板项目,更多功能参考 [Umi Max 简介](https://umijs.org/docs/max/introduce)
15 changes: 15 additions & 0 deletions studio/config/config.dev.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// https://umijs.org/config/
import { defineConfig } from 'umi';

export default defineConfig({
plugins: [
// https://github.com/zthxxx/react-dev-inspector
'react-dev-inspector/plugins/umi/react-inspector',
],
// https://github.com/zthxxx/react-dev-inspector#inspector-loader-props
inspectorConfig: {
exclude: [],
babelPlugins: [],
babelOptions: {},
},
});
16 changes: 16 additions & 0 deletions studio/config/config.embed.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// https://umijs.org/config/
import { defineConfig } from 'umi';

export default defineConfig({
outputPath: '../assets',
publicPath: '/assets/',
history: {
type: 'hash',
},
codeSplitting: {
jsStrategy: 'granularChunks'
},
esbuildMinifyIIFE: true,
favicons: ['/assets/gene.png'],
proxy: undefined,
});
82 changes: 82 additions & 0 deletions studio/config/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// https://umijs.org/config/
import { defineConfig } from 'umi';
import path from 'path';

import proxy from './proxy';
import { routes as defaultRoutes } from './routes';

const isDev = process.env.NODE_ENV === 'development';
const isStatic = isDev ? true : (process.env.UMI_APP_IS_STATIC ? process.env.UMI_APP_IS_STATIC : false);

export default defineConfig({
hash: true,
history: {
type: 'hash',
},
publicPath: '/',
antd: {},
access: {},
model: {},
initialState: {},
request: {},
// plugins: ['@umijs/plugins/dist/request'],
npmClient: 'yarn',
dva: {},
chainWebpack: (config: any) => {
config.merge({
resolve: {
fallback: {
'perf_hooks': false,
}
}
});

// https://github.com/webpack/webpack/discussions/13585
config.resolve.alias.set('perf_hooks', path.resolve(__dirname, 'perf_hooks.ts'));
// console.log("config.resolve.alias", config.resolve.alias);
},
define: {
// Whether the frontend is separated from the backend.
isStatic: isStatic,
},
layout: {
// https://umijs.org/docs/max/layout-menu
locale: false,
},
targets: {
chrome: 80
},
// umi routes: https://umijs.org/docs/routing
// We load routes dynamically from the config file.
routes: defaultRoutes,
// Theme for antd: https://ant.design/docs/react/customize-theme-cn
theme: {
// 如果不想要 configProvide 动态设置主题需要把这个设置为 default
// 只有设置为 variable, 才能使用 configProvide 动态设置主色调
// https://ant.design/docs/react/customize-theme-variable-cn
'root-entry-name': 'variable',
},
title: false,
ignoreMomentLocale: true,
// proxy: proxy[REACT_APP_ENV || 'dev'],
proxy: proxy['dev'],
manifest: {
basePath: '/',
},
// Fast Refresh 热更新
fastRefresh: true,
// https://pro.ant.design/docs/openapi
// openAPI: [
// {
// requestLibPath: "import { request } from 'umi'",
// // schemaPath: join(__dirname, 'api.json'),
// // You may need to open the apifox before running `yarn openapi`.
// // schemaPath: "http://127.0.0.1:4523/export/openapi?projectId=1645899&version=3.1",
// // TODO: ApiFox cannot import the spec correctly.
// schemaPath: "http://localhost:8000/spec",
// projectName: "swagger",
// mock: false,
// }
// ],
mfsu: {}
});
Loading

0 comments on commit 44aa545

Please sign in to comment.