From a389a87cefbf0c98b71320813bef816520687e22 Mon Sep 17 00:00:00 2001 From: ElderJames Date: Thu, 16 Sep 2021 15:41:55 +0800 Subject: [PATCH] chore: fix docs aot publish --- .github/workflows/nightly-build-AOT.yml | 95 ------------------------- .github/workflows/release-AOT.yml | 80 +++++++++++++++++++++ .github/workflows/release.yml | 47 ------------ 3 files changed, 80 insertions(+), 142 deletions(-) delete mode 100644 .github/workflows/nightly-build-AOT.yml create mode 100644 .github/workflows/release-AOT.yml diff --git a/.github/workflows/nightly-build-AOT.yml b/.github/workflows/nightly-build-AOT.yml deleted file mode 100644 index 040b48d2..00000000 --- a/.github/workflows/nightly-build-AOT.yml +++ /dev/null @@ -1,95 +0,0 @@ -ο»Ώname: Publish Docs with AOT - -env: - NUGET_API_KEY: ${{secrets.NUGET_API_KEY}} - -on: - push: - branches: - - master - - feature - -jobs: - publish-and-deploy: - runs-on: ubuntu-latest - if: github.repository_owner == 'ant-design-blazor' - - steps: - - name: Checkout πŸ›ŽοΈ - uses: actions/checkout@v2 - with: - persist-credentials: false - - - name: Setup .NET Core 3.1 - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 3.1.300 - - - name: Setup .NET Core 5.0 - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 5.0.100 - - - name: Setup .NET 6.0 - uses: actions/setup-dotnet@v1 - with: - dotnet-version: "6.0.x" - include-prerelease: true - - - uses: actions/setup-node@v1 - with: - node-version: "10.x" - - - name: "Get Last Release" - id: previoustag - run: | - LAST_VERSION=$(wget --no-check-certificate -qO- https://api.github.com/repos/ant-design-blazor/ant-design-blazor/tags | grep 'name' | cut -d\" -f4 | head -1) - echo "Last Version: ${LAST_VERSION}" - echo "::set-output name=previous_tag::${LAST_VERSION}" - - - name: "Get Next Semantic Version" - id: semvers - uses: "WyriHaximus/github-action-next-semvers@v1" - with: - version: ${{ steps.previoustag.outputs.previous_tag }} - - - name: "Get Next Version" - id: get_next_version - run: | - current_branch=$(git symbolic-ref --short -q HEAD) - echo Current git branch is $current_branch - next_version='' - if [ "$current_branch" == 'master' ] ; - then - next_version=$patch_version - else - next_version=$minor_version - fi - echo "::set-output name=current_branch::${current_branch}" - FULL_VERSION=$next_version-nightly-`date "+%y%m%d%H%M"` - echo "Version: ${FULL_VERSION}" - echo "::set-output name=package_version::${FULL_VERSION}" - env: - patch_version: ${{ steps.semvers.outputs.patch }} - minor_version: ${{ steps.semvers.outputs.minor }} - - - name: Prepare AOT workload - run: | - dotnet workload install wasm-tools - - - name: Publish Docs πŸŽ‰ - run: | - npm install - sed -i s/{version}/$PACKAGE_VERSION/g ./site/AntDesign.Docs/Shared/HeaderMenu.razor - dotnet build - dotnet publish ./site/AntDesign.Docs.Wasm -c Release -f net6 -o cargo -p:EnableAOT=true - env: - PACKAGE_VERSION: ${{ steps.pack.outputs.package_version }} - - - name: Deploy Preview πŸš€ - run: | - npm install -g surge - surge --project ./cargo/wwwroot --domain $BRANCH-aot-antblazor.surge.sh - env: - SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} - BRANCH: ${{ steps.get_next_version.outputs.current_branch }} diff --git a/.github/workflows/release-AOT.yml b/.github/workflows/release-AOT.yml new file mode 100644 index 00000000..be2b48e7 --- /dev/null +++ b/.github/workflows/release-AOT.yml @@ -0,0 +1,80 @@ +ο»Ώname: Publish Docs with AOT + +on: + push: + tags: + - "*" + +jobs: + publish-and-deploy: + runs-on: ubuntu-latest + if: github.repository_owner == 'ant-design-blazor' + + steps: + - name: Checkout πŸ›ŽοΈ + uses: actions/checkout@v2 + with: + persist-credentials: false + + - name: Setup .NET Core 3.1 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.1.300 + + - name: Setup .NET Core 5.0 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.100 + + - name: Setup .NET 6.0 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: "6.0.x" + include-prerelease: true + + - uses: actions/setup-node@v1 + with: + node-version: "10.x" + + - name: Prepare AOT workload + run: | + dotnet workload install wasm-tools + + - name: Publish Docs πŸŽ‰ + id: publish + run: | + VERSION=`git describe --tags` + echo "::set-output name=package_version::${VERSION}" + npm install + echo "/* updated `date "+%Y-%m-%d %H:%M:%S"` */" >> ./site/AntDesign.Docs.Wasm/wwwroot/service-worker.published.js + cp -rf scripts/gh-pages/* scripts/gh-pages/.nojekyll scripts/gh-pages/.spa ./site/AntDesign.Docs.Wasm/wwwroot + sed -i s/{version}/$VERSION/g ./site/AntDesign.Docs.Wasm/wwwroot/index.html + sed -i s/{version}/$VERSION/g ./site/AntDesign.Docs/Shared/HeaderMenu.razor + dotnet build + dotnet publish ./site/AntDesign.Docs.Wasm -c Release -f net6 -o cargo -p:EnableAOT=true + + - name: Deploy πŸš€ + uses: JamesIves/github-pages-deploy-action@releases/v3 + with: + ACCESS_TOKEN: ${{ secrets.GH_PUSH_TOKEN }} + BRANCH: gh-pages + FOLDER: cargo/wwwroot + + - name: Deploy to Github.io πŸš€ + uses: peaceiris/actions-gh-pages@v3 + with: + personal_token: ${{ secrets.GH_PUSH_TOKEN }} + external_repository: ant-design-blazor/ant-design-blazor.github.io + publish_branch: master + publish_dir: ./cargo/wwwroot + cname: antblazor.com + keep_files: true + tag_name: ${{ steps.publish.outputs.package_version }} + + - name: Sync to Gitee πŸ’• + uses: wearerequired/git-mirror-action@master + env: + SSH_PRIVATE_KEY: ${{ secrets.GITEE_PRIVATE_KEY }} + with: + source-repo: "git@github.com:ant-design-blazor/ant-design-blazor.git" + destination-repo: "git@gitee.com:ant-design-blazor/ant-design-blazor.git" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6e55b0a9..a79ece55 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,16 +26,6 @@ jobs: with: dotnet-version: 5.0.100 - - name: Setup .NET 6.0 - uses: actions/setup-dotnet@v1 - with: - dotnet-version: "6.0.x" - include-prerelease: true - - - name: Prepare AOT workload - run: | - dotnet workload install wasm-tools - - uses: actions/setup-node@v1 with: node-version: "10.x" @@ -45,7 +35,6 @@ jobs: run: | VERSION=`git describe --tags` echo "Publishing Version: ${VERSION}" - echo "::set-output name=package_version::${VERSION}" npm install dotnet build dotnet pack components/AntDesign.csproj /p:PackageVersion=$VERSION -c Release -o publish @@ -58,39 +47,3 @@ jobs: name: package path: publish/ retention-days: 5 - - - name: Publish Docs πŸŽ‰ - run: | - echo "/* updated `date "+%Y-%m-%d %H:%M:%S"` */" >> ./site/AntDesign.Docs.Wasm/wwwroot/service-worker.published.js - cp -rf scripts/gh-pages/* scripts/gh-pages/.nojekyll scripts/gh-pages/.spa ./site/AntDesign.Docs.Wasm/wwwroot - sed -i s/{version}/$PACKAGE_VERSION/g ./site/AntDesign.Docs.Wasm/wwwroot/index.html - sed -i s/{version}/$PACKAGE_VERSION/g ./site/AntDesign.Docs/Shared/HeaderMenu.razor - dotnet publish ./site/AntDesign.Docs.Wasm -c Release -f net6 -o cargo -p:EnableAOT=true - env: - PACKAGE_VERSION: ${{ steps.pack.outputs.package_version }} - - - name: Deploy πŸš€ - uses: JamesIves/github-pages-deploy-action@releases/v3 - with: - ACCESS_TOKEN: ${{ secrets.GH_PUSH_TOKEN }} - BRANCH: gh-pages - FOLDER: cargo/wwwroot - - - name: Deploy to Github.io πŸš€ - uses: peaceiris/actions-gh-pages@v3 - with: - personal_token: ${{ secrets.GH_PUSH_TOKEN }} - external_repository: ant-design-blazor/ant-design-blazor.github.io - publish_branch: master - publish_dir: ./cargo/wwwroot - cname: antblazor.com - keep_files: true - tag_name: ${{ steps.pack.outputs.package_version }} - - - name: Sync to Gitee πŸ’• - uses: wearerequired/git-mirror-action@master - env: - SSH_PRIVATE_KEY: ${{ secrets.GITEE_PRIVATE_KEY }} - with: - source-repo: "git@github.com:ant-design-blazor/ant-design-blazor.git" - destination-repo: "git@gitee.com:ant-design-blazor/ant-design-blazor.git"