-
-
Notifications
You must be signed in to change notification settings - Fork 738
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'discord-net:dev' into fix/channel-topic-nre
- Loading branch information
Showing
26 changed files
with
292 additions
and
72 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,130 @@ | ||
name: Dotnet Build | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
on: | ||
push: | ||
branches: ["dev"] | ||
tags: ["*"] | ||
paths-ignore: | ||
- 'docs/**' | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
name: Build and Test | ||
runs-on: ubuntu-latest | ||
env: | ||
ArtifactStagingDirectory: "artifacts" | ||
IsTagBuild: false | ||
DOTNET_INSTALL_DIR: "/usr/share/dotnet" | ||
Suffix: ${{ github.run_number }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 8.0.x | ||
|
||
- name: Is Tag Build | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: echo "IsTagBuild=true" >> $GITHUB_ENV | ||
|
||
- name: Generate Suffix | ||
if: env.IsTagBuild != 'true' | ||
run: echo "Suffix=$(date +'%Y%m%d')-${{ github.run_number }}" >> $GITHUB_ENV | ||
|
||
- name: Restore | ||
run: dotnet restore ./Discord.Net.sln -v minimal | ||
|
||
- name: Build | ||
run: dotnet build "Discord.Net.sln" -v minimal -c Release --no-restore /p:BuildNumber=${{ env.Suffix }} /p:IsTagBuild=$(IsTagBuild) | ||
|
||
- name: Unit Test | ||
run: dotnet test "test/Discord.Net.Tests.Unit/Discord.Net.Tests.Unit.csproj" --no-restore --no-build -v minimal -c Release --logger trx | ||
|
||
- name: Analyzer Test | ||
run: dotnet test "test/Discord.Net.Analyzers.Tests/Discord.Net.Analyzers.Tests.csproj" --no-restore --no-build -v minimal -c Release --logger trx | ||
|
||
- name: Publish Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
if: failure() || success() | ||
with: | ||
files: ./**/*.trx | ||
|
||
- name: Pack | ||
env: | ||
buildNumber: $Suffix | ||
run: | | ||
dotnet pack "src\Discord.Net.Core\Discord.Net.Core.csproj" --no-restore --no-build -v minimal -c Release -o ${{ env.ArtifactStagingDirectory }} /p:BuildNumber=${{ env.Suffix }} /p:IsTagBuild=${{ env.IsTagBuild }} | ||
dotnet pack "src\Discord.Net.Rest\Discord.Net.Rest.csproj" --no-restore --no-build -v minimal -c Release -o ${{ env.ArtifactStagingDirectory }} /p:BuildNumber=${{ env.Suffix }} /p:IsTagBuild=${{ env.IsTagBuild }} | ||
dotnet pack "src\Discord.Net.WebSocket\Discord.Net.WebSocket.csproj" --no-restore --no-build -v minimal -c Release -o ${{ env.ArtifactStagingDirectory }} /p:BuildNumber=${{ env.Suffix }} /p:IsTagBuild=${{ env.IsTagBuild }} | ||
dotnet pack "src\Discord.Net.Commands\Discord.Net.Commands.csproj" --no-restore --no-build -v minimal -c Release -o ${{ env.ArtifactStagingDirectory }} /p:BuildNumber=${{ env.Suffix }} /p:IsTagBuild=${{ env.IsTagBuild }} | ||
dotnet pack "src\Discord.Net.Webhook\Discord.Net.Webhook.csproj" --no-restore --no-build -v minimal -c Release -o ${{ env.ArtifactStagingDirectory }} /p:BuildNumber=${{ env.Suffix }} /p:IsTagBuild=${{ env.IsTagBuild }} | ||
dotnet pack "src\Discord.Net.Analyzers\Discord.Net.Analyzers.csproj" --no-restore --no-build -v minimal -c Release -o ${{ env.ArtifactStagingDirectory }} /p:BuildNumber=${{ env.Suffix }} /p:IsTagBuild=${{ env.IsTagBuild }} | ||
dotnet pack "src\Discord.Net.Interactions\Discord.Net.Interactions.csproj" --no-restore --no-build -v minimal -c Release -o ${{ env.ArtifactStagingDirectory }} /p:BuildNumber=${{ env.Suffix }} /p:IsTagBuild=${{ env.IsTagBuild }} | ||
dotnet pack "experiment\Discord.Net.BuildOverrides\Discord.Net.BuildOverrides.csproj" --no-restore --no-build -v minimal -c Release -o ${{ env.ArtifactStagingDirectory }} /p:BuildNumber=${{ env.Suffix }} /p:IsTagBuild=${{ env.IsTagBuild }} | ||
- name: Publish Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: discord-net | ||
path: ${{ env.ArtifactStagingDirectory }}/* | ||
|
||
deploy: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
if: github.event_name != 'pull_request' | ||
env: | ||
IsTagBuild: false | ||
ArtifactStagingDirectory: "artifacts" | ||
REPOSITORY_URL: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Is Tag Build | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: echo "IsTagBuild=true" >> $GITHUB_ENV | ||
|
||
- name: Generate Suffix | ||
run: echo "Suffix=$(date +'%Y%m%d')-${{ github.run_number }}" >> $GITHUB_ENV | ||
|
||
- name: setup NuGet | ||
uses: nuget/setup-nuget@v2 | ||
with: | ||
nuget-version: '6.x' | ||
|
||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: discord-net | ||
path: ${{ env.ArtifactStagingDirectory }} | ||
|
||
- name: Pack Metapackage | ||
if: env.IsTagBuild != 'true' | ||
run: nuget pack "src/Discord.Net/Discord.Net.nuspec" -OutputDirectory ${{ env.ArtifactStagingDirectory }} -Suffix $Suffix | ||
|
||
- name: Pack Metapackage | ||
if: env.IsTagBuild == 'true' | ||
run: nuget pack "src/Discord.Net/Discord.Net.nuspec" -OutputDirectory ${{ env.ArtifactStagingDirectory }} | ||
|
||
- name: Set API Keys | ||
run: | | ||
nuget setApiKey ${{ secrets.NUGET_API_KEY }} -Source https://api.nuget.org/v3/index.json | ||
nuget setApiKey ${{ secrets.NIGHTLY_FEED_API_KEY }} -Source ${{ vars.NIGHTLY_FEED }} | ||
nuget setApiKey ${{ secrets.GITHUB_TOKEN }} -Source ${{ env.REPOSITORY_URL }} | ||
- name: Push Nightly | ||
if: vars.PUSH_NIGHTLY == 'true' | ||
run: nuget push ${{ env.ArtifactStagingDirectory }}/*.nupkg -Source ${{ vars.NIGHTLY_FEED }} | ||
|
||
- name: Push Nightly to GitHub Pacakges | ||
if: vars.PUSH_NIGHTLY == 'true' | ||
run: nuget push ${{ env.ArtifactStagingDirectory }}/*.nupkg -Source ${{ env.REPOSITORY_URL }} | ||
|
||
- name: Push Release | ||
if: env.IsTagBuild == 'true' && vars.PUSH_NUGET == 'true' | ||
run: nuget push ${{ env.ArtifactStagingDirectory }}/*.nupkg -Source https://api.nuget.org/v3/index.json |
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
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,73 @@ | ||
# Discord.Net | ||
|
||
**Discord.Net** is an unofficial .NET API Wrapper for the Discord API (https://discord.com/developers/docs/intro). | ||
|
||
## 📄 Documentation | ||
|
||
- https://discordnet.dev | ||
- [Sample Projects](https://github.com/discord-net/Discord.Net/tree/dev/samples) in our repository | ||
|
||
## Feedback | ||
|
||
You report issues with the library by opening an issue in our [GitHub Repository](https://github.com/discord-net/Discord.Net) | ||
|
||
If you need help with using Discord.Net check out the following: | ||
- ask on our [Discord Support Server](https://discord.gg/dnet) | ||
- start a thread in [GitHub Discussions](https://github.com/discord-net/Discord.Net/discussions) | ||
|
||
## 📥 Installation | ||
|
||
### Stable (NuGet) | ||
|
||
Our stable builds available from NuGet through the Discord.Net metapackage: | ||
|
||
- [Discord.Net](https://www.nuget.org/packages/Discord.Net/) | ||
|
||
The individual components may also be installed from NuGet: | ||
|
||
- _Webhooks_ | ||
- [Discord.Net.Webhook](https://www.nuget.org/packages/Discord.Net.Webhook/) | ||
|
||
- _Text-Command & Interaction services._ | ||
- [Discord.Net.Commands](https://www.nuget.org/packages/Discord.Net.Commands/) | ||
- [Discord.Net.Interactions](https://www.nuget.org/packages/Discord.Net.Interactions/) | ||
|
||
- _Complete API coverage._ | ||
- [Discord.Net.WebSocket](https://www.nuget.org/packages/Discord.Net.WebSocket/) | ||
- [Discord.Net.Rest](https://www.nuget.org/packages/Discord.Net.Rest/) | ||
|
||
- _The API core. Implements only entities and barebones functionality._ | ||
- [Discord.Net.Core](https://www.nuget.org/packages/Discord.Net.Core/) | ||
|
||
### Unstable | ||
|
||
Nightly builds are available through our MyGet feed (`https://www.myget.org/F/discord-net/api/v3/index.json`). | ||
These builds target the dev branch. | ||
|
||
## 🩷 Supporting Discord.Net | ||
|
||
Discord.Net is an MIT-licensed open source project with its development made possible entirely by volunteers. | ||
If you'd like to support our efforts financially, please consider: | ||
|
||
- [Contributing on Open Collective](https://opencollective.com/discordnet). | ||
|
||
## 🛑 Known Issues | ||
|
||
### WebSockets (Win7 and earlier) | ||
|
||
.NET Core 1.1 does not support WebSockets on Win7 and earlier. | ||
This issue has been fixed since the release of .NET Core 2.1. | ||
It is recommended to target .NET Core 2.1 or above for your project if you wish to run your bot on legacy platforms; | ||
alternatively, you may choose to install the | ||
[Discord.Net.Providers.WS4Net](https://www.nuget.org/packages/Discord.Net.Providers.WS4Net/) package. | ||
|
||
### TLS on .NET Framework. | ||
|
||
Discord supports only TLS1.2+ on all their websites including the API since 07/19/2022. | ||
.NET Framework does not support this protocol by default. | ||
If you depend on .NET Framework, it is suggested to upgrade your project to `net6-windows`. | ||
This framework supports most of the windows-only features introduced by fx, and resolves startup errors from the TLS protocol mismatch. | ||
|
||
## 🗃️ Versioning Guarantees | ||
|
||
This library generally abides by [Semantic Versioning](https://semver.org). Packages are published in `MAJOR.MINOR.PATCH` version format. |
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.