diff --git a/.github/workflows/auto-all-publish.yml b/.github/workflows/auto-all-publish.yml new file mode 100644 index 0000000000..40620e7b10 --- /dev/null +++ b/.github/workflows/auto-all-publish.yml @@ -0,0 +1,85 @@ +name: Auto All Publish + +on: + push: + tags: + - 'v*' + +jobs: + build: + runs-on: windows-latest + outputs: + publishVersion: ${{ steps.parseTag.outputs.publishVersion }} + steps: + - name: CheckOut Code + uses: actions/checkout@master + with: + ref: dev + + - name: Parse Tag + id: parseTag + uses: actions/github-script@v6 + with: + script: | + const tag = `${{ github.ref_name }}` + const publishVersion = tag.slice(3) + core.setOutput('publishVersion', publishVersion) + + - 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 -t ${{ steps.parseTag.outputs.publishVersion }} + + - name: Run Build Sass Common + run: pnpm build:ui saas-common -t ${{ steps.parseTag.outputs.publishVersion }} -d saas + + - name: Run Build Runtime + run: pnpm build:runtime + + - name: Run Build Theme + run: pnpm build:theme + + - 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: Publish Vue3 And Vue2 components + run: pnpm pub:all + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Release + if: contains(github.ref_name, 'alpha') == false + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ github.ref_name }} + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} diff --git a/.github/workflows/auto-publish.yml b/.github/workflows/auto-publish.yml deleted file mode 100644 index e4e11a22b2..0000000000 --- a/.github/workflows/auto-publish.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Auto publish - -on: - push: - tags: - - 'v*' - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: CheckOut Code - uses: actions/checkout@master - with: - ref: release - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 18 - registry-url: 'https://registry.npmjs.org' - - - name: Run Build Scripts - run: | - npm i --legacy-peer-deps - npm run build:vue3 - npm run release3 - - - name: Publish - run: npm publish opentiny-vue-${{ github.ref_name }}.tgz - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: Release - if: contains(github.ref_name, 'alpha') == false - uses: softprops/action-gh-release@v1 - with: - tag_name: v${{ github.ref_name }} - generate_release_notes: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index 3c0ba1e59a..9d8ef1be85 100644 --- a/package.json +++ b/package.json @@ -75,6 +75,11 @@ "pub3": "pnpm --filter=\"./packages/dist3/**\" publish --no-git-checks --access=public", "pub2.7": "pnpm --filter=\"./packages/dist2.7/**\" publish --tag v2.7-latest --no-git-checks --access=public", "pub:aurora": "pnpm --filter=\"./packages/dist2/@aurora/**\" publish --no-git-checks --access=public", + "pub:theme": "pnpm --filter=\"./packages/theme/dist\" publish --no-git-checks --access=public", + "pub:themeMobile": "pnpm --filter=\"./packages/theme-mobile/dist/\" publish --no-git-checks --access=public", + "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:all": "pnpm pub2 && pnpm pub3 && pnpm pub:theme && pnpm pub:themeMobile && pnpm pub:themeSaas && pnpm pub:renderless", "// ---------- unit单元测试 ----------": "", "test:unit2": "pnpm -C examples/vue2 test:unit", "test:unit2.7": "pnpm -C examples/vue2.7 test:unit",