Skip to content

Commit

Permalink
add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ElderJames committed Dec 2, 2023
1 parent f2ef3b7 commit 523c287
Show file tree
Hide file tree
Showing 6 changed files with 168 additions and 5 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish Package

env:
Version: 0.1.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-dotnet@v1
with:
dotnet-version: 6.0.101

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

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

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

- name: Package Nightly Nuget 📦
run: |
npm i
SUFFIX=`date "+%y%m%d%H%M%S"`
dotnet build
dotnet pack src/CssInCs.csproj /p:PackageVersion=$Version-nightly-${SUFFIX} -c Release -o publish
- name: Publish to Nuget ✔
run: |
dotnet nuget push publish/*.nupkg -s https://api.nuget.org/v3/index.json -k $NUGET_API_KEY --skip-duplicate
39 changes: 39 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Pull Request Checks

on:
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.100

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

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

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

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

- name: Check Building ⚙
run: |
npm i
dotnet build
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
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

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.300

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

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

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

- uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.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/CssInCs.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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -338,3 +338,5 @@ ASALocalRun/

# BeatPulse healthcheck temp database
healthchecksdb

*.DotSettings
25 changes: 22 additions & 3 deletions src/CssInCs.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFrameworks>netstandard2.1;net5;net6;net7</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net5;net6;net7;net8</TargetFrameworks>
<LangVersion>latest</LangVersion>
<OutputType>Library</OutputType>
<IsPackable>true</IsPackable>
Expand All @@ -10,6 +10,24 @@
<ImplicitUsings>disable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageId>CssInCSharp</PackageId>
<Copyright>.NET Foundation and Contributors</Copyright>
<Authors>Yoli</Authors>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageReadmeFile>README.md</PackageReadmeFile>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<RepositoryType>git</RepositoryType>
</ItemGroup>

<ItemGroup>
<!-- The nuget package icon -->
<None Include="..\README.md" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework) == 'netstandard2.1'">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.0" />
</ItemGroup>
Expand All @@ -26,7 +44,8 @@
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
<None Remove="CssInCs.csproj.DotSettings" />
<ItemGroup Condition="$(TargetFramework) == 'net8'">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.0" />
</ItemGroup>

</Project>
2 changes: 0 additions & 2 deletions src/CssInCs.csproj.DotSettings

This file was deleted.

0 comments on commit 523c287

Please sign in to comment.