Skip to content

Commit 4aafd89

Browse files
authored
Chore: add setup .NET 7 SDK and release script for github actions (#17)
1 parent 9fe170d commit 4aafd89

File tree

3 files changed

+64
-8
lines changed

3 files changed

+64
-8
lines changed

.github/workflows/gh-pages.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,18 @@ jobs:
2020
with:
2121
persist-credentials: false
2222

23-
- name: Setup .NET Core 3.1
23+
- name: Setup .NET Core 7.0
2424
uses: actions/setup-dotnet@v1
2525
with:
26-
dotnet-version: 3.1.300
27-
28-
- name: Setup .NET Core 5.0
29-
uses: actions/setup-dotnet@v1
30-
with:
31-
dotnet-version: 5.0.100
26+
dotnet-version: 7.0.100
3227

3328
- name: Publish Docs 🎉
3429
run: |
3530
cd ./src/UEditor.Docs.WebAssembly/wwwroot
3631
cp -rf gh-pages/* gh-pages/.nojekyll gh-pages/.spa ./
3732
cd ../../../
3833
dotnet build
39-
dotnet publish -c Release -f net5 -o cargo
34+
dotnet publish -c Release -f net7 -o cargo
4035
4136
- name: Deploy 🚀
4237
uses: JamesIves/github-pages-deploy-action@releases/v3

.github/workflows/pr-checks.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Pull Request Checks
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v1
14+
15+
- uses: actions/setup-dotnet@v1
16+
with:
17+
dotnet-version: 7.0.100
18+
19+
- uses: actions/setup-node@v1
20+
with:
21+
node-version: '10.x'
22+
23+
- name: Check Building ⚙
24+
run: |
25+
npm i
26+
dotnet build

.github/workflows/release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Release
2+
3+
env:
4+
NUGET_API_KEY: ${{secrets.NUGET_API_KEY}}
5+
6+
on:
7+
push:
8+
tags:
9+
- '*'
10+
11+
jobs:
12+
release-and-publish-package:
13+
runs-on: ubuntu-latest
14+
if: github.repository_owner == 'ant-design-blazor'
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- uses: actions/setup-dotnet@v1
20+
with:
21+
dotnet-version: 7.0.100
22+
23+
- uses: actions/setup-node@v1
24+
with:
25+
node-version: '10.x'
26+
27+
- name: Package and publish to Nuget📦
28+
run: |
29+
VERSION=`git describe --tags`
30+
echo "Publishing Version: ${VERSION}"
31+
npm install
32+
dotnet build
33+
rm -rf ./node_modules
34+
dotnet pack src/UEditor/UEditor.csproj /p:PackageVersion=$VERSION -c Release -o publish
35+
dotnet nuget push publish/*.nupkg -s https://api.nuget.org/v3/index.json -k $NUGET_API_KEY --skip-duplicate

0 commit comments

Comments
 (0)