|
| 1 | +name: Dispatch All Publish Alpha |
| 2 | +run-name: Dispatch All Publish Alpha--${{ inputs.version }} |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + version: |
| 8 | + description: | |
| 9 | + 输入您将要发布的版本号, |
| 10 | + 例如: `3.xx.xx`. |
| 11 | + required: true |
| 12 | + type: string |
| 13 | +concurrency: |
| 14 | + group: ${{ github.workflow }}-${{ github.sha }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
| 17 | +jobs: |
| 18 | + build: |
| 19 | + runs-on: windows-latest |
| 20 | + outputs: |
| 21 | + publishVersion: ${{ steps.parseVersion.outputs.publishVersion }} |
| 22 | + steps: |
| 23 | + - name: Parse Version |
| 24 | + id: parseVersion |
| 25 | + uses: actions/github-script@v6 |
| 26 | + with: |
| 27 | + script: | |
| 28 | + const version = `${{ inputs.version }}` |
| 29 | + if(/^\d\.\d+\.\d+/.test(vserion)) { |
| 30 | + throw new Error('版本号格式不正确') |
| 31 | + } |
| 32 | + const publishVersion = version.slice(2) |
| 33 | + core.setOutput('publishVersion', publishVersion) |
| 34 | +
|
| 35 | + - name: CheckOut Code |
| 36 | + uses: actions/checkout@master |
| 37 | + with: |
| 38 | + ref: ${{ github.ref_name }} |
| 39 | + |
| 40 | + - name: Setup pnpm |
| 41 | + uses: pnpm/action-setup@v2 |
| 42 | + |
| 43 | + - name: Setup Node |
| 44 | + uses: actions/setup-node@v3 |
| 45 | + with: |
| 46 | + node-version: 20.10.0 |
| 47 | + registry-url: 'https://registry.npmjs.org' |
| 48 | + |
| 49 | + - name: Get pnpm store directory |
| 50 | + id: pnpm-cache |
| 51 | + run: | |
| 52 | + echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT |
| 53 | +
|
| 54 | + - uses: actions/cache@v3 |
| 55 | + name: Setup pnpm cache |
| 56 | + with: |
| 57 | + path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} |
| 58 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 59 | + restore-keys: | |
| 60 | + ${{ runner.os }}-pnpm-store- |
| 61 | + - name: Install dependencies |
| 62 | + run: pnpm i --no-frozen-lockfile |
| 63 | + |
| 64 | + - name: Run Build Components |
| 65 | + run: pnpm build:ui -t ${{ steps.parseVersion.outputs.publishVersion }} |
| 66 | + |
| 67 | + - name: Run Build Sass Common |
| 68 | + run: pnpm build:ui saas-common -t ${{ steps.parseVersion.outputs.publishVersion }} -d saas |
| 69 | + |
| 70 | + - name: Run Build Theme |
| 71 | + run: pnpm build:theme |
| 72 | + |
| 73 | + - name: Run Build Renderless |
| 74 | + run: pnpm build:renderless |
| 75 | + |
| 76 | + - name: Run Build ThemeSaas |
| 77 | + run: pnpm build:themeSaas |
| 78 | + |
| 79 | + - name: Run Build ThemeMobile |
| 80 | + run: pnpm build:themeMobile |
| 81 | + |
| 82 | + - name: Run Build Runtime |
| 83 | + run: pnpm build:runtime |
| 84 | + |
| 85 | + - name: Run Release alpha |
| 86 | + run: pnpm release:alpha |
| 87 | + |
| 88 | + - name: Publish Vue3 And Vue2 components |
| 89 | + run: pnpm pub:all |
| 90 | + env: |
| 91 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_OPENTINY_VUE_TOKEN }} |
0 commit comments