Skip to content

Commit

Permalink
fix: daily fix
Browse files Browse the repository at this point in the history
  • Loading branch information
devcui committed Mar 21, 2024
1 parent c1e2f5e commit 1a91dd8
Show file tree
Hide file tree
Showing 7 changed files with 1,698 additions and 1,114 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: CI

# on: push
on:
pull_request:
push:
Expand All @@ -10,10 +11,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jwalton/gh-find-current-pr@master
id: findPr
with:
state: all
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
Expand All @@ -24,7 +21,7 @@ jobs:
env:
ACCESS_REPO: ${{ github.repository }}
ACCESS_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
PR_NUMBER: ${{ steps.findPr.outputs.pr }}
PR_NUMBER: ${{ github.event.number }}
- uses: actions/cache@v3
with:
path: ./node_modules
Expand All @@ -39,8 +36,9 @@ jobs:
- name: Build site
run: yarn run site:build
- name: 'Deploy Site'
if: github.event.number
run: |
export DEPLOY_DOMAIN=https://preview-${{ steps.findPr.outputs.pr }}-ng-yunzai-yelon.surge.sh
export DEPLOY_DOMAIN=https://preview-${{ github.event.number }}-ng-yunzai-yelon.surge.sh
echo "Deploy to $DEPLOY_DOMAIN"
cp ./src/dist/browser/index.html ./src/dist/browser/404.html
npx surge --project ./src/dist/browser --domain $DEPLOY_DOMAIN
Expand All @@ -50,20 +48,21 @@ jobs:
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
- name: 'Update comment on github'
if: github.event.number
run: |
export DEPLOY_DOMAIN=https://preview-${{ steps.findPr.outputs.pr }}-ng-yunzai-yelon.surge.sh
export DEPLOY_DOMAIN=https://preview-${{ github.event.number }}-ng-yunzai-yelon.surge.sh
node ./scripts/github/comment.js "[Preview is ready!]($DEPLOY_DOMAIN)"
env:
ACCESS_REPO: ${{ github.repository }}
ACCESS_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
PR_NUMBER: ${{ steps.findPr.outputs.pr }}
PR_NUMBER: ${{ github.event.number }}
- name: 'When failed'
if: failure()
if: github.event.number && failure()
run: node ./scripts/github/comment.js "[Preview Build Failed!](https://github.com/hbyunzai/yelon/actions/runs/${{ github.run_id }})"
env:
ACCESS_REPO: ${{ github.repository }}
ACCESS_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
PR_NUMBER: ${{ steps.findPr.outputs.pr }}
PR_NUMBER: ${{ github.event.number }}

test:
runs-on: ubuntu-latest
Expand Down
66 changes: 33 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,22 @@
"postinstall": "ng-less-javascript-enabled-patch"
},
"dependencies": {
"@angular/animations": "^17.1.0",
"@angular/cdk": "^17.1.0",
"@angular/common": "^17.1.0",
"@angular/compiler": "^17.1.0",
"@angular/core": "^17.1.0",
"@angular/elements": "^17.1.0",
"@angular/forms": "^17.1.0",
"@angular/platform-browser": "^17.1.0",
"@angular/platform-browser-dynamic": "^17.1.0",
"@angular/platform-server": "^17.1.0",
"@angular/router": "^17.1.0",
"@angular/service-worker": "^17.1.0",
"@angular/ssr": "^17.1.0",
"@angular/animations": "^17.2.0",
"@angular/cdk": "^17.2.0",
"@angular/common": "^17.2.0",
"@angular/compiler": "^17.2.0",
"@angular/core": "^17.2.0",
"@angular/elements": "^17.2.0",
"@angular/forms": "^17.2.0",
"@angular/platform-browser": "^17.2.0",
"@angular/platform-browser-dynamic": "^17.2.0",
"@angular/platform-server": "^17.2.0",
"@angular/router": "^17.2.0",
"@angular/service-worker": "^17.2.0",
"@angular/ssr": "^17.2.0",
"@antv/data-set": "^0.11.8",
"@antv/g2": "^4.2.10",
"@github/hotkey": "^2.3.0",
"@github/hotkey": "^2.3.1",
"@ng-util/monaco-editor": "^17.0.1",
"@nrwl/angular": "18.0.4",
"@stackblitz/sdk": "^1.9.0",
Expand All @@ -78,8 +78,8 @@
"ajv-formats": "^2.1.1",
"aos": "^3.0.0-beta.6",
"codesandbox": "^2.2.3",
"echarts": "^5.4.3",
"express": "^4.18.2",
"echarts": "^5.5.0",
"express": "^4.18.3",
"extend": "^3.0.2",
"file-saver": "^2.0.5",
"isutf8": "^4.0.0",
Expand All @@ -96,17 +96,17 @@
"zone.js": "~0.14.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "^17.1.0",
"@angular-devkit/build-angular": "^17.2.1",
"@angular-eslint/builder": "^17.2.0",
"@angular-eslint/eslint-plugin": "^17.2.0",
"@angular-eslint/eslint-plugin-template": "^17.2.0",
"@angular-eslint/schematics": "^17.2.0",
"@angular-eslint/template-parser": "^17.2.0",
"@angular/cli": "^17.1.0",
"@angular/compiler-cli": "^17.1.0",
"@angular/language-service": "^17.1.0",
"@commitlint/cli": "^18.4.4",
"@commitlint/config-angular": "^18.4.4",
"@angular/cli": "^17.2.1",
"@angular/compiler-cli": "^17.2.0",
"@angular/language-service": "^17.2.0",
"@commitlint/cli": "^18.6.1",
"@commitlint/config-angular": "^18.6.1",
"@types/aos": "^3.0.7",
"@types/deep-extend": "^0.6.2",
"@types/express": "^4.17.21",
Expand All @@ -116,18 +116,18 @@
"@types/jasmine": "~5.1.0",
"@types/jasminewd2": "~2.0.13",
"@types/mockjs": "^1.0.10",
"@types/node": "^18.19.8",
"@types/node": "^18.19.22",
"@types/parse5": "^7.0.0",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"chalk": "^5.3.0",
"codecov": "^3.8.3",
"conventional-changelog-cli": "^4.1.0",
"eslint": "^8.56.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "~9.1.0",
"eslint-plugin-deprecation": "~2.0.0",
"eslint-plugin-import": "~2.29.1",
"eslint-plugin-jsdoc": "~48.0.2",
"eslint-plugin-jsdoc": "~48.0.6",
"eslint-plugin-prefer-arrow": "~1.2.3",
"eslint-plugin-prettier": "~5.1.3",
"fs-extra": "^11.2.0",
Expand All @@ -153,28 +153,28 @@
"less-plugin-clean-css": "^1.5.1",
"less-plugin-npm-import": "^2.1.0",
"less-vars-to-js": "^1.3.0",
"lint-staged": "^15.2.0",
"lint-staged": "^15.2.2",
"mark-twain": "^2.0.3",
"mockjs": "^1.1.0",
"mustache": "^4.2.0",
"ng-less-javascript-enabled-patch": "^17.0.2",
"ng-packagr": "^17.1.0",
"ng-packagr": "^17.2.0",
"ng-yunzai-plugin-theme": "latest",
"ng-yunzai-sts": "latest",
"parse5": "^7.1.2",
"plyr": "^3.7.8",
"prettier": "^3.2.4",
"prettier": "^3.2.5",
"readline-sync": "^1.4.10",
"screenfull": "^6.0.2",
"sitemap": "^7.1.1",
"source-map-explorer": "^2.5.3",
"stream": "0.0.2",
"stylelint": "^16.1.0",
"stylelint-config-clean-order": "^5.4.0",
"stylelint": "^16.2.1",
"stylelint-config-clean-order": "^5.4.1",
"stylelint-config-standard": "^36.0.0",
"stylelint-declaration-block-no-ignored-properties": "^2.8.0",
"swagger-typescript-api": "^12.0.4",
"terser": "^5.27.0",
"terser": "^5.29.1",
"ts-node": "~10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "~5.3.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class StartupService {
private router = inject(Router);<% if (i18n) { %>
private i18n = inject<I18NService>(YUNZAI_I18N_TOKEN);<% } %>
// If http request allows anonymous access, you need to add `ALLOW_ANONYMOUS`:
// this.httpClient.get('assets/tmp/app-data.json', { context: new HttpContext().set(ALLOW_ANONYMOUS, true) })
// this.httpClient.get('/app', { context: new HttpContext().set(ALLOW_ANONYMOUS, true) })
private appData$ = this.httpClient.get('./assets/tmp/app-data.json').pipe(
catchError((res: NzSafeAny) => {
console.warn(`StartupService.load: Network request failed`, res);
Expand Down
4 changes: 2 additions & 2 deletions schematics/plugin/plugin.icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,9 @@ export function pluginIcon(options: PluginOptions): Rule {
const icons = getIcons(options, tree);
genIconFile(options, tree, icons);
console.log(`\n\n`);
console.log(`生成成功,如果是首次运行,需要手动引用,参考:https://ng.yunzainfo.com/theme/icon/zh`);
console.log(`生成成功,如果是首次运行,需要手动引用,参考:https://ng-alain.com/theme/icon/zh`);
console.log(
`Finished, if it's first run, you need manually reference it, refer to: https://ng.yunzainfo.com/theme/icon/en`
`Finished, if it's first run, you need manually reference it, refer to: https://ng-alain.com/theme/icon/en`
);
console.log(`\n\n`);
};
Expand Down
19 changes: 2 additions & 17 deletions scripts/ci/build-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

set -e


if [ -z ${ACCESS_TOKEN} ]; then
echo "Error: No access token for GitHub could be found." \
"Please set the environment variable 'ACCESS_TOKEN'."
Expand All @@ -24,19 +23,6 @@ cd $(dirname $0)/../..

DIST="$(pwd)/dist"

# if [[ ${commitAuthorName} != 'yunzai-bot' && ${commitAuthorName} != 'yunzai-bot' ]]; then
# echo "Warning: Just only yunzai-bot or yunzai-bot user"
# exit 0
# fi

# echo "ACCESS_TOKEN: ${ACCESS_TOKEN}.."

if [ -z ${ACCESS_TOKEN} ]; then
echo "Error: No access token for GitHub could be found." \
"Please set the environment variable 'ACCESS_TOKEN'."
exit 0
fi

buildDir=${DIST}/publish
rm -rf ${buildDir}
mkdir -p ${buildDir}
Expand All @@ -45,7 +31,7 @@ cp -r ${DIST}/ng-yunzai ${buildDir}/ng-yunzai

packageRepo=yelon-builds
buildVersion=$(node -pe "require('./package.json').version")
branchName=${TRAVIS_BRANCH:-'master'}
branchName=${BRANCH:-'master'}

buildVersionName="${buildVersion}-${commitSha}"
buildTagName=${TAG_NAME:-"${branchName}-${commitSha}"}
Expand All @@ -54,13 +40,11 @@ if [[ -n "${GITHUB_HEAD_REF}" ]]; then
fi
buildCommitMessage="${branchName} - ${MESSAGE}"


repoUrl="https://github.com/hbyunzai/${packageRepo}.git"
repoDir="${DIST}/${packageRepo}"

echo "Starting publish process ${buildVersionName} into ${branchName}(tag:${buildTagName}).."


rm -rf ${repoDir}
mkdir -p ${repoDir}

Expand Down Expand Up @@ -108,6 +92,7 @@ echo "https://${ACCESS_TOKEN}:@github.com" > .git/credentials

if [[ $(git ls-remote origin "refs/tags/${buildTagName}") ]]; then
echo "removed tag because tag is already published"
# git push origin :refs/tags/${buildTagName}
git push --delete origin ${buildTagName}
fi

Expand Down
10 changes: 5 additions & 5 deletions scripts/publish/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ clone() {
cd ${DIST}
echo ">>> Clone yelon & cli dist..."
git clone --depth 1 https://github.com/hbyunzai/yelon-builds.git
BUILD_VERSION=$(node -p "require('${ROOT}/ng-yunzai/package.json').version")
if [[ $VERSION != $BUILD_VERSION ]]; then
echo "待发布版本[${VERSION}]与远程版本[${BUILD_VERSION}]不一致"
exit 1
fi
BUILD_VERSION=$(node -p "require('${ROOT}/ng-yunzai/package.json').version")
if [[ $VERSION != $BUILD_VERSION ]]; then
echo "待发布版本[${VERSION}]与远程版本[${BUILD_VERSION}]不一致"
exit 1
fi
}

publishToMaster() {
Expand Down
Loading

0 comments on commit 1a91dd8

Please sign in to comment.