name: Publish Docs env: Version: 0.5.0 NUGET_API_KEY: ${{secrets.NUGET_API_KEY}} on: push: branches: - master 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 uses: actions/setup-dotnet@v1 with: dotnet-version: 5.0.100 - uses: actions/setup-node@v1 with: node-version: "10.x" - name: Test And Coverage Report 📝 run: | dotnet build dotnet test --collect:"XPlat Code Coverage" find ./tests -name "coverage.cobertura.xml" -type f -exec cp {} ./ \; bash <(curl -s https://codecov.io/bash) -Z -f coverage.cobertura.xml -t $CODECOV_TOKEN env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: Publish Docs 🎉 run: | 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 dotnet build dotnet publish ./site/AntDesign.Docs.Wasm -c Release -f net5 -o cargo - 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 - name: Package Nightly Nuget 📦 run: | FULL_VERSION=$Version-nightly-`date "+%y%m%d%H%M"` echo "Version: ${FULL_VERSION}" echo "::set-env name=FULL_VERSION::${FULL_VERSION}" dotnet pack components/AntDesign.csproj /p:PackageVersion=${FULL_VERSION} -c Release -o publish --no-build --no-restore - name: Publish to Nuget ✔ run: | dotnet nuget push publish/*.nupkg -s https://api.nuget.org/v3/index.json -k $NUGET_API_KEY --skip-duplicate # - name: Publish to npm 🎁 # env: # NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # run: | # dotnet publish scripts/npm -c Release -o npm-publish # cp ./scripts/npm/package.json ./npm-publish/wwwroot/ # cd ./npm-publish/wwwroot/ # echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc # npm version ${{ env.FULL_VERSION }} # npm publish - 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" - name: Reload Gitee Pages 😆 uses: mizuka-wu/gitee-pages-action@v1.0.0 with: repository: ant-design-blazor/ant-design-blazor cookie: ${{ secrets.GITEE_COOKIE }} branch: gh-pages