Skip to content

Commit

Permalink
[ci-skip] Switch ci (DSharpPlus#1221)
Browse files Browse the repository at this point in the history
* Remove old AppVeyor files to pave way for GH Actions

* Updated .gitignore

* Tested and confirmed that CI works as intended

* Update README.md

* ✨ Grammar ✨

* Update last AppVeyor number and formatting

* Update last AppVeyor build id

* Update last AppVeyor build id

* Update last AppVeyor build id
  • Loading branch information
OoLunar authored Mar 17, 2022
1 parent fb8daee commit d40f512
Show file tree
Hide file tree
Showing 12 changed files with 235 additions and 952 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/publish_nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Publish Nightly"
on:
push:
branches:
- master

jobs:
publish_nightly:
runs-on: "ubuntu-latest"
if: "!contains(toJSON(github.event.commits.*.message), '[ci-skip]')"
steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Setup .NET"
uses: "actions/setup-dotnet@v1"
with:
dotnet-version: "6.0.x"

- name: "Build Nightly Nuget Packages"
run: "mkdir build && dotnet pack -p:SymbolPackageFormat=snupkg --include-symbols --include-source -o build -p:VersionSuffix='nightly' -p:BuildNumber=0$(( 1091 + ${{ github.run_number }} ))" # We add 1091 since it's the last build number AppVeyor used.

- name: "Publish Nightly Nuget Packages"
run: "dotnet nuget push \"build/*\" -k ${{ secrets.NUGET_ORG_API_KEY }} -s https://api.nuget.org/v3/index.json" # If the package version does not comply with SemVer, it will be set as a pre-release version automatically.
33 changes: 33 additions & 0 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Publish Release"
on:
release:
types: ["published"]

jobs:
publish_release:
runs-on: "ubuntu-latest"
if: "!contains(toJSON(github.event.commits.*.message), '[ci-skip]')"
steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Setup .NET"
uses: "actions/setup-dotnet@v1"
with:
dotnet-version: "6.0.x"

- name: "Build Nuget Packages"
run: "mkdir build && dotnet pack -p:SymbolPackageFormat=snupkg --include-symbols -c Release -o build"

- name: "Publish Nuget Packages"
run: "dotnet nuget push \"build/*\" -k ${{ secrets.NUGET_ORG_API_KEY }} -s https://api.nuget.org/v3/index.json"

- name: "Upload Nuget Packages To Github Release"
uses: "ncipollo/release-action@v1"
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: "build/*"
token: ${{ secrets.GITHUB_TOKEN }}
omitBodyDuringUpdate: true # We don't want to update the body of the release.
omitNameDuringUpdate: true # We don't want to update the name of the release.
20 changes: 20 additions & 0 deletions .github/workflows/test_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Test PR"
on:
pull_request:

jobs:
build_pr:
runs-on: "ubuntu-latest"
if: "!contains(toJSON(github.event.commits.*.message), '[ci-skip]')"
steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Setup .NET"
uses: "actions/setup-dotnet@v1"
with:
dotnet-version: "6.0.x"

- name: "Build PR"
run: "dotnet build --nologo"
# TODO: Complete DSharpPlus.Test package. Utilizing Github secrets, we can run the bot and have it execute tests on the PR to ensure there aren't any breaking changes.
Loading

0 comments on commit d40f512

Please sign in to comment.