From 523c287c2e03c69f9c5fea32f441e19cb9e01e5b Mon Sep 17 00:00:00 2001 From: James Yeung Date: Sat, 2 Dec 2023 13:19:28 +0800 Subject: [PATCH] add ci --- .github/workflows/package.yml | 53 +++++++++++++++++++++++++++++++++ .github/workflows/pr-checks.yml | 39 ++++++++++++++++++++++++ .github/workflows/release.yml | 52 ++++++++++++++++++++++++++++++++ .gitignore | 2 ++ src/CssInCs.csproj | 25 ++++++++++++++-- src/CssInCs.csproj.DotSettings | 2 -- 6 files changed, 168 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/package.yml create mode 100644 .github/workflows/pr-checks.yml create mode 100644 .github/workflows/release.yml delete mode 100644 src/CssInCs.csproj.DotSettings diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 0000000..372bf77 --- /dev/null +++ b/.github/workflows/package.yml @@ -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 diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml new file mode 100644 index 0000000..a054c46 --- /dev/null +++ b/.github/workflows/pr-checks.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..cfcb35b --- /dev/null +++ b/.github/workflows/release.yml @@ -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 diff --git a/.gitignore b/.gitignore index 37876ad..2997059 100644 --- a/.gitignore +++ b/.gitignore @@ -338,3 +338,5 @@ ASALocalRun/ # BeatPulse healthcheck temp database healthchecksdb + +*.DotSettings \ No newline at end of file diff --git a/src/CssInCs.csproj b/src/CssInCs.csproj index 4eb8732..7574d1c 100644 --- a/src/CssInCs.csproj +++ b/src/CssInCs.csproj @@ -1,7 +1,7 @@  - netstandard2.1;net5;net6;net7 + netstandard2.1;net5;net6;net7;net8 latest Library true @@ -10,6 +10,24 @@ disable + + CssInCSharp + .NET Foundation and Contributors + Yoli + true + true + true + snupkg + README.md + true + git + + + + + + + @@ -26,7 +44,8 @@ - - + + + diff --git a/src/CssInCs.csproj.DotSettings b/src/CssInCs.csproj.DotSettings deleted file mode 100644 index 44b01aa..0000000 --- a/src/CssInCs.csproj.DotSettings +++ /dev/null @@ -1,2 +0,0 @@ - - True \ No newline at end of file