-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(workflows): add ui and renderless alpha pubish action (#2799)
* fix: fix all publish alpha packages action error * feat: add ui and renderless alpha pubish action
- Loading branch information
Showing
3 changed files
with
167 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
94 changes: 94 additions & 0 deletions
94
.github/workflows/dispatch-renderless-theme-publish-alpha.yml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: Dispatch Renderless Theme Runtime | ||
run-name: Dispatch Renderless Theme Runtime--${{ inputs.components }} | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
components: | ||
description: | | ||
输入需要打包的模块名称,多个以英文逗号分隔, | ||
例如: `theme,renderless,runtime` | ||
required: true | ||
type: string | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.sha }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Parse Components | ||
id: parseComponents | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const branchName = `${{ github.ref_name }}` | ||
const moduleName = `${{ inputs.components }}` | ||
if (!moduleName.includes('theme') && !moduleName.includes('renderless') && !moduleName.includes('runtime')) { | ||
throw new Error('请输入正确的包名称') | ||
} | ||
if (!branchName.includes('release-3.')) { | ||
throw new Error('请使用release-3.xx.xx分支发布正式包') | ||
} | ||
- name: CheckOut Code | ||
uses: actions/checkout@master | ||
with: | ||
ref: ${{ github.ref_name }} | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
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 | ||
- 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- | ||
- name: Install dependencies | ||
run: pnpm i --no-frozen-lockfile | ||
|
||
- name: Run Build Theme | ||
if: contains(inputs.components, 'theme') == true | ||
run: pnpm build:theme | ||
|
||
- name: Run Build Renderless | ||
if: contains(inputs.components, 'renderless') == true | ||
run: pnpm build:renderless | ||
|
||
- name: Run Build ThemeSaas | ||
if: contains(inputs.components, 'theme-saas') == true | ||
run: pnpm build:themeSaas | ||
|
||
- name: Run Build ThemeMobile | ||
if: contains(inputs.components, 'theme-mobile') == true | ||
run: pnpm build:themeMobile | ||
|
||
- name: Run Build Runtime | ||
if: contains(inputs.components, 'runtime') == true | ||
run: pnpm build:runtime | ||
|
||
- name: Run Release alpha | ||
run: pnpm release:alpha | ||
|
||
- name: Publish | ||
run: | | ||
pnpm pub:all | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_OPENTINY_VUE_TOKEN }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Dispatch Ui Publish | ||
run-name: Dispatch Ui--${{ inputs.components }} | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
components: | ||
description: | | ||
输入需要打包的组件名称,多个以空格分隔, | ||
例如: `input alert`. | ||
required: true | ||
type: string | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.sha }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Parse Components | ||
id: parseComponents | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const branchName = `${{ github.ref_name }}` | ||
if (!branchName.includes('release-3.')) { | ||
throw new Error('请使用release-3.xx.xx分支发布正式包') | ||
} | ||
- name: CheckOut Code | ||
uses: actions/checkout@master | ||
with: | ||
ref: ${{ github.ref_name }} | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
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 | ||
- 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- | ||
- name: Install dependencies | ||
run: pnpm i --no-frozen-lockfile | ||
|
||
- name: Run Build Components | ||
run: pnpm build:ui ${{ inputs.components }} | ||
|
||
- name: Run Release alpha | ||
run: pnpm release:alpha | ||
|
||
- name: Publish | ||
run: | | ||
pnpm pub:all | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_OPENTINY_VUE_TOKEN }} |