Skip to content

Commit

Permalink
Chore: add setup .NET 7 SDK and release script for github actions (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElderJames authored Jul 3, 2023
1 parent 9fe170d commit 4aafd89
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 8 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,18 @@ jobs:
with:
persist-credentials: false

- name: Setup .NET Core 3.1
- name: Setup .NET Core 7.0
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
dotnet-version: 7.0.100

- name: Publish Docs 🎉
run: |
cd ./src/UEditor.Docs.WebAssembly/wwwroot
cp -rf gh-pages/* gh-pages/.nojekyll gh-pages/.spa ./
cd ../../../
dotnet build
dotnet publish -c Release -f net5 -o cargo
dotnet publish -c Release -f net7 -o cargo
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@releases/v3
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Pull Request Checks

on:
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.100

- uses: actions/setup-node@v1
with:
node-version: '10.x'

- name: Check Building ⚙
run: |
npm i
dotnet build
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release

env:
NUGET_API_KEY: ${{secrets.NUGET_API_KEY}}

on:
push:
tags:
- '*'

jobs:
release-and-publish-package:
runs-on: ubuntu-latest
if: github.repository_owner == 'ant-design-blazor'

steps:
- uses: actions/checkout@v2

- uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.100

- uses: actions/setup-node@v1
with:
node-version: '10.x'

- name: Package and publish to Nuget📦
run: |
VERSION=`git describe --tags`
echo "Publishing Version: ${VERSION}"
npm install
dotnet build
rm -rf ./node_modules
dotnet pack src/UEditor/UEditor.csproj /p:PackageVersion=$VERSION -c Release -o publish
dotnet nuget push publish/*.nupkg -s https://api.nuget.org/v3/index.json -k $NUGET_API_KEY --skip-duplicate

0 comments on commit 4aafd89

Please sign in to comment.