test(schema): optimize script for generating schemas #3306
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build enterprise package | |
on: | |
pull_request: | |
branches: | |
- '**enterprise**' | |
- 'dev/e/*' | |
push: | |
branches: | |
- '**enterprise**' | |
- 'dev/e/*' | |
workflow_call: | |
secrets: | |
VITE_CLOUD_AI_SQL_ASSISTANT_API_URL_CN: | |
required: true | |
VITE_CLOUD_AI_SQL_ASSISTANT_API_URL_EN: | |
required: true | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
container: node:20.17 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install pnpm | |
run: npm install -g pnpm | |
- name: install zip | |
run: apt-get update && apt-get install -y zip | |
- name: build | |
env: | |
VITE_CLOUD_AI_SQL_ASSISTANT_API_URL_CN: ${{ secrets.VITE_CLOUD_AI_SQL_ASSISTANT_API_URL_CN }} | |
VITE_CLOUD_AI_SQL_ASSISTANT_API_URL_EN: ${{ secrets.VITE_CLOUD_AI_SQL_ASSISTANT_API_URL_EN }} | |
run: | | |
pnpm install | |
pnpm build:enterprise | |
- name: create package | |
run: | | |
touch dist/version | |
echo "github_ref: $GITHUB_REF" >> dist/version | |
echo "github_sha: $GITHUB_SHA" >> dist/version | |
PACKAGE_NAME=$(echo ${GITHUB_REF##*/}) # Extract tag from GITHUB_REF | |
zip -rq emqx-enterprise-dashboard-$PACKAGE_NAME.zip ./dist | |
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: emqx-enterprise-dashboard | |
path: dist/ | |
- name: Create Release | |
if: startsWith(github.ref, 'refs/tags/') | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: EMQX Dashboard ${{ github.ref }} Released | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
if: startsWith(github.ref, 'refs/tags/') | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./emqx-enterprise-dashboard-${{ env.PACKAGE_NAME }}.zip | |
asset_name: emqx-enterprise-dashboard-${{ env.PACKAGE_NAME }}.zip | |
asset_content_type: application/zip |