forked from ant-design-blazor/ant-design-blazor
-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (98 loc) · 4.02 KB
/
nightly-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Publish Docs
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
- 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: '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 Will release version $next_version for branch $current_branch
echo "::set-output name=next_version::${next_version}"
echo "::set-output name=current_branch::${current_branch}"
env:
patch_version: ${{ steps.semvers.outputs.patch }}
minor_version: ${{ steps.semvers.outputs.minor }}
- name: Package Nightly Nuget 📦
id: pack
run: |
FULL_VERSION=$next_version-nightly-`date "+%y%m%d%H%M"`
echo "Version: ${FULL_VERSION}"
echo "::set-output name=package_version::${FULL_VERSION}"
dotnet pack components/AntDesign.csproj /p:PackageVersion=${FULL_VERSION} -c Release -o publish
dotnet pack tests/AntDesign.TestKit/AntDesign.TestKit.csproj /p:PackageVersion=${FULL_VERSION} -c Release -o publish
env:
next_version: ${{ steps.get_next_version.outputs.next_version }}
- name: Push to MyGet package registry
run: dotnet nuget push ./publish/*.nupkg --source https://www.myget.org/F/ant-design-blazor/api/v3/index.json --api-key ${{ secrets.MYGET_API_KEY }} --skip-duplicate
- name: Sync to Gitee 💕
uses: wearerequired/git-mirror-action@master
env:
SSH_PRIVATE_KEY: ${{ secrets.GITEE_PRIVATE_KEY }}
with:
source-repo: "[email protected]:ant-design-blazor/ant-design-blazor.git"
destination-repo: "[email protected]:ant-design-blazor/ant-design-blazor.git"
- name: Publish Docs 🎉
run: |
npm install
sed -i s/{version}/$PACKAGE_VERSION/g ./site/AntDesign.Docs/Shared/HeaderMenu.razor
dotnet publish ./site/AntDesign.Docs.Wasm -c Release -f net5 -o cargo
env:
PACKAGE_VERSION: ${{ steps.pack.outputs.package_version }}
- name: Deploy Preview 🚀
run: |
npm install -g surge
surge --project ./cargo/wwwroot --domain $BRANCH-antblazor.surge.sh
env:
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
BRANCH: ${{ steps.get_next_version.outputs.current_branch }}