ci: fix formatting (#51971)

This commit is contained in:
𝑾𝒖𝒙𝒉 2024-12-14 22:46:48 +08:00 committed by GitHub
parent 88bf8bc9d8
commit 48f85d6785
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,6 +14,11 @@ jobs:
build-site: build-site:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: (startsWith(github.ref, 'refs/tags/') && (contains(github.ref_name, '-') == false)) || github.event_name == 'workflow_dispatch' if: (startsWith(github.ref, 'refs/tags/') && (contains(github.ref_name, '-') == false)) || github.event_name == 'workflow_dispatch'
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-defining-outputs-for-a-job
outputs:
formatted_version: ${{ steps.shared-formatted_version.outputs.VERSION }}
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -46,6 +51,11 @@ jobs:
path: _site/ path: _site/
retention-days: 1 # Not need to keep for too long retention-days: 1 # Not need to keep for too long
- name: Format version
if: ${{ always() }}
id: shared-formatted_version
run: echo "VERSION=$(echo ${{ github.ref_name }} | sed 's/\./-/g')" >> $GITHUB_OUTPUT
deploy-to-pages: deploy-to-pages:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build-site needs: build-site
@ -58,10 +68,6 @@ jobs:
name: real-site name: real-site
path: _site path: _site
- name: Get version
id: publish-version
run: echo "VERSION=$(echo ${{ github.ref_name }} | sed 's/\./-/g')" >> $GITHUB_OUTPUT
- name: Deploy to GitHub Pages - name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4 uses: peaceiris/actions-gh-pages@v4
with: with:
@ -81,15 +87,15 @@ jobs:
- name: Deploy to Surge (with TAG) - name: Deploy to Surge (with TAG)
run: | run: |
export DEPLOY_DOMAIN=ant-design-${{ steps.publish-version.outputs.VERSION }}.surge.sh export DEPLOY_DOMAIN=ant-design-${{ needs.build-site.outputs.formatted_version }}.surge.sh
bunx surge --project ./_site --domain $DEPLOY_DOMAIN --token ${{ secrets.SURGE_TOKEN }} bunx surge --project ./_site --domain $DEPLOY_DOMAIN --token ${{ secrets.SURGE_TOKEN }}
- name: Create Commit Comment - name: Create Commit Comment
uses: peter-evans/commit-comment@v3 uses: peter-evans/commit-comment@v3
with: with:
body: | body: |
- Documentation site for this release: https://ant-design-${{ steps.publish-version.outputs.VERSION }}.surge.sh - Documentation site for this release: https://ant-design-${{ needs.build-site.outputs.formatted_version }}.surge.sh
- Webpack bundle analyzer report page: https://ant-design-${{ steps.publish-version.outputs.VERSION }}.surge.sh/report.html - Webpack bundle analyzer report page: https://ant-design-${{ needs.build-site.outputs.formatted_version }}.surge.sh/report.html
# https://github.com/ant-design/ant-design/pull/49213/files#r1625446496 # https://github.com/ant-design/ant-design/pull/49213/files#r1625446496
upload-to-release: upload-to-release:
@ -107,8 +113,7 @@ jobs:
- name: Tarball site - name: Tarball site
run: | run: |
cd ./_site cd ./_site
VERSION=$(echo ${{ github.ref_name }} | sed 's/\./-/g') tar -czf ../website.tar.gz --transform 's|^|antd-${{ needs.build-site.outputs.formatted_version }}-website/|' .
tar -czf ../website.tar.gz --transform 's|^|antd-${VERSION}-website/|' .
cd .. cd ..
- name: Upload to Release - name: Upload to Release