-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
418 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Kook.Net Test | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
target: | ||
description: 'Targeting OS' | ||
required: true | ||
type: string | ||
dotnet-version: | ||
description: '.NET version' | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build_and_test: | ||
name: Build and Test | ||
runs-on: ${{ inputs.target }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: ${{ inputs.dotnet-version }} | ||
|
||
- name: Cache Dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.nuget/packages | ||
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', 'Kook.Net.targets') }} | ||
restore-keys: | | ||
${{ runner.os }}-nuget | ||
- name: Restore Dependencies | ||
run: dotnet restore src | ||
|
||
- name: Build | ||
run: dotnet build src --no-restore | ||
|
||
- name: Test | ||
run: dotnet test src --no-build --verbosity normal --filter Category!=Integration --blame-hang-timeout 15min |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Kook.Net Documentation | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
dotnet-version: | ||
description: '.NET version' | ||
required: true | ||
type: string | ||
secrets: | ||
DOC_DEPLOY_KEY: | ||
description: 'NuGet API Key' | ||
required: true | ||
|
||
jobs: | ||
doc: | ||
name: Publish Documentation | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: ${{ inputs.dotnet-version }} | ||
|
||
- name: Cache Dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.nuget/packages | ||
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', 'Kook.Net.targets') }} | ||
restore-keys: | | ||
${{ runner.os }}-nuget | ||
- name: Restore Dependencies | ||
run: dotnet restore src | ||
|
||
- name: Build | ||
run: dotnet build src --no-restore | ||
|
||
- uses: nikeee/[email protected] | ||
name: Build Doc | ||
with: | ||
args: ./docs/docfx.json | ||
|
||
- uses: finnp/create-file-action@master | ||
name: Add CNAME | ||
env: | ||
FILE_NAME: "docs/_site/CNAME" | ||
FILE_DATA: "kooknet.dev" | ||
|
||
- name: Publish Doc | ||
uses: cpina/github-action-push-to-another-repository@main | ||
env: | ||
API_TOKEN_GITHUB: ${{ secrets.DOC_DEPLOY_KEY }} | ||
with: | ||
source-directory: docs/_site/ | ||
destination-github-username: gehongyan | ||
destination-repository-username: gehongyan | ||
destination-repository-name: Kook.Net.Doc | ||
target-directory: docs | ||
user-email: [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Kook.Net Packages | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
dotnet-version: | ||
description: '.NET version' | ||
required: true | ||
type: string | ||
secrets: | ||
NUGET_API_KEY: | ||
description: 'NuGet API Key' | ||
required: true | ||
GITHUB_PACKAGES_KEY: | ||
description: 'GitHub API Key' | ||
required: true | ||
|
||
jobs: | ||
push_packages: | ||
name: Push Packages | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: ${{ inputs.dotnet-version }} | ||
|
||
- name: Cache Dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.nuget/packages | ||
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', 'Kook.Net.targets') }} | ||
restore-keys: | | ||
${{ runner.os }}-nuget | ||
- name: Generate Packages | ||
run: dotnet pack src --configuration Release --output packages | ||
|
||
- name: Push Packages to NuGet | ||
run: dotnet nuget push .\packages\*.nupkg -k $env:NUGET_API_KEY -s https://api.nuget.org/v3/index.json --skip-duplicate | ||
env: | ||
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | ||
|
||
- name: Push Packages to Github | ||
run: dotnet nuget push .\packages\*.nupkg -k $env:GITHUB_PACKAGES_KEY -s https://nuget.pkg.github.com/gehongyan/index.json --skip-duplicate | ||
env: | ||
GITHUB_PACKAGES_KEY: ${{ secrets.GITHUB_PACKAGES_KEY }} | ||
|
||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Packages | ||
path: ./packages/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Kook.Net on Push or Pull Request | ||
|
||
on: | ||
push: | ||
branches: [ master, dev ] | ||
pull_request: | ||
branches: [ master, dev ] | ||
|
||
jobs: | ||
build_and_test: | ||
name: Build and Test | ||
strategy: | ||
matrix: | ||
target: [ windows-latest, ubuntu-latest, macOS-latest ] | ||
uses: ./.github/workflows/build-test.yml | ||
with: | ||
target: ${{ matrix.target }} | ||
dotnet-version: 7.0.x | ||
|
||
call_push_packages: | ||
name: Push Packages | ||
needs: build_and_test | ||
uses: ./.github/workflows/packages.yml | ||
with: | ||
dotnet-version: 7.0.x | ||
secrets: | ||
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | ||
GITHUB_PACKAGES_KEY: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Kook.Net on Release | ||
|
||
on: | ||
release: | ||
types: [ published ] | ||
|
||
jobs: | ||
build_and_test: | ||
name: Build and Test | ||
strategy: | ||
matrix: | ||
target: [ windows-latest, ubuntu-latest, macOS-latest ] | ||
uses: ./.github/workflows/build-test.yml | ||
with: | ||
target: ${{ matrix.target }} | ||
dotnet-version: 7.0.x | ||
|
||
call_doc: | ||
name: Generate Documentation | ||
needs: build_and_test | ||
uses: ./.github/workflows/doc.yml | ||
with: | ||
dotnet-version: 7.0.x | ||
secrets: | ||
DOC_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Changelog | ||
|
||
--- | ||
|
||
## v0.1.0 [2022-11-15] | ||
|
||
Initial release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
uid: Changelog | ||
title: 变更日志 | ||
--- | ||
|
||
|
||
# 变更日志 | ||
|
||
## v0.1.0 [2022-11-15] | ||
|
||
首次发布。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- name: 变更日志 | ||
topicUid: Changelog |
Oops, something went wrong.