Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(workflows): add runtime publish git-action #2764

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .github/workflows/auto-all-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,25 @@ jobs:
with:
node-version: 20.10.0
registry-url: 'https://registry.npmjs.org'

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
${{ runner.os }}-pnpm-store-
Comment on lines +39 to +51
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Update actions/cache to latest version

The runner version for the cache action is outdated. Update to the latest version to ensure compatibility with GitHub Actions.

      - uses: actions/cache@v3
+     - uses: actions/cache@v4
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
${{ runner.os }}-pnpm-store-
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
🧰 Tools
🪛 actionlint (1.7.4)

45-45: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

- name: Install dependencies
run: pnpm i --no-frozen-lockfile

- name: Run Build Components
run: pnpm build:ui -t ${{ steps.parseTag.outputs.publishVersion }}

- name: Run Build Sass Common
run: pnpm build:ui saas-common -t ${{ steps.parseTag.outputs.publishVersion }} -d saas

Expand All @@ -63,13 +63,16 @@ jobs:

- name: Run Build Renderless
run: pnpm build:renderless

- name: Run Build ThemeSaas
run: pnpm build:themeSaas

- name: Run Build ThemeMobile
run: pnpm build:themeMobile

- name: Run Build Runtime
run: pnpm build:runtime

- name: Publish Vue3 And Vue2 components
run: pnpm pub:all
env:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dispatch-renderless-theme-publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Dispatch Renderless Theme
run-name: Dispatch Renderless Theme--${{ inputs.components }}
name: Dispatch Renderless Theme Runtime
run-name: Dispatch Renderless Theme Runtime--${{ inputs.components }}

on:
workflow_dispatch:
Expand All @@ -26,7 +26,7 @@ jobs:
const branchName = `${{ github.ref_name }}`
const moduleName = `${{ inputs.components }}`

if (!moduleName.includes('theme') && !moduleName.includes('renderless')) {
if (!moduleName.includes('theme') && !moduleName.includes('renderless') && !moduleName.includes('runtime')) {
throw new Error('请输入正确的包名称')
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"pub:themeSaas": "pnpm --filter=\"./packages/theme-saas/dist\" publish --no-git-checks --access=public",
"pub:renderless": "pnpm --filter=\"./packages/renderless/dist\" publish --no-git-checks --access=public",
"pub:runtime": "pnpm --filter=\"./packages/vue-runtime/\" publish --no-git-checks --access=public",
"pub:all": "pnpm pub2 && pnpm pub3 && pnpm pub:theme && pnpm pub:themeMobile && pnpm pub:themeSaas && pnpm pub:renderless",
"pub:all": "pnpm pub2 && pnpm pub3 && pnpm pub:theme && pnpm pub:themeMobile && pnpm pub:themeSaas && pnpm pub:renderless && pub:runtime",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that the pub:runtime command is correctly added to the pub:all script. It should be prefixed with pnpm to maintain consistency with other commands.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix missing pnpm prefix in pub:all script

The pub:runtime command is missing the pnpm prefix, which could cause the publish to fail.

-    "pub:all": "pnpm pub2 && pnpm pub3 && pnpm pub:theme && pnpm pub:themeMobile && pnpm pub:themeSaas && pnpm pub:renderless && pub:runtime",
+    "pub:all": "pnpm pub2 && pnpm pub3 && pnpm pub:theme && pnpm pub:themeMobile && pnpm pub:themeSaas && pnpm pub:renderless && pnpm pub:runtime",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"pub:all": "pnpm pub2 && pnpm pub3 && pnpm pub:theme && pnpm pub:themeMobile && pnpm pub:themeSaas && pnpm pub:renderless && pub:runtime",
"pub:all": "pnpm pub2 && pnpm pub3 && pnpm pub:theme && pnpm pub:themeMobile && pnpm pub:themeSaas && pnpm pub:renderless && pnpm pub:runtime",

"pub:site": "pnpm -C examples/sites pub",
"// ---------- 自动化发测试包 ----------": "",
"auto-build-pub": "pnpm -C internals/automate auto-build-pub",
Expand Down
Loading