Bump versions #332
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
name: Build and Publish | |
on: push | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build -c Release --no-restore --warnaserror | |
- name: Test | |
run: dotnet test -c Release --no-build --verbosity normal | |
- name: Pack | |
if: github.ref_name == 'stable' || github.ref_name == 'alpha' | |
run: | | |
dotnet pack NetCord -c Release --no-build | |
dotnet pack NetCord.Services -c Release --no-build | |
dotnet pack Hosting/NetCord.Hosting -c Release --no-build | |
dotnet pack Hosting/NetCord.Hosting.Services -c Release --no-build | |
dotnet pack Hosting/NetCord.Hosting.AspNetCore -c Release --no-build | |
- name: Publish | |
if: github.ref_name == 'stable' || github.ref_name == 'alpha' | |
run: | | |
dotnet nuget push NetCord/bin/Release/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -n -s https://api.nuget.org/v3/index.json --skip-duplicate | |
dotnet nuget push NetCord.Services/bin/Release/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -n -s https://api.nuget.org/v3/index.json --skip-duplicate | |
dotnet nuget push Hosting/NetCord.Hosting/bin/Release/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -n -s https://api.nuget.org/v3/index.json --skip-duplicate | |
dotnet nuget push Hosting/NetCord.Hosting.Services/bin/Release/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -n -s https://api.nuget.org/v3/index.json --skip-duplicate | |
dotnet nuget push Hosting/NetCord.Hosting.AspNetCore/bin/Release/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -n -s https://api.nuget.org/v3/index.json --skip-duplicate | |
- name: Build Documentation | |
if: github.ref_name == 'stable' || github.ref_name == 'alpha' | |
run: | | |
dotnet tool install docfx -g --version 2.70.0 | |
docfx Documentation/docfx.json | |
- name: Stop Apache2 | |
if: github.ref_name == 'stable' || github.ref_name == 'alpha' | |
uses: appleboy/ssh-action@v0.1.7 | |
with: | |
username: ${{ secrets.SSH_USERNAME }} | |
host: ${{ secrets.SSH_HOST }} | |
port: ${{ secrets.SSH_PORT }} | |
key: ${{ secrets.SSH_KEY }} | |
script: sudo systemctl stop apache2 | |
- name: Deploy Documentation | |
if: github.ref_name == 'stable' || github.ref_name == 'alpha' | |
uses: appleboy/scp-action@v0.1.3 | |
with: | |
username: ${{ secrets.SSH_USERNAME }} | |
host: ${{ secrets.SSH_HOST }} | |
port: ${{ secrets.SSH_PORT }} | |
key: ${{ secrets.SSH_KEY }} | |
rm: true | |
source: Documentation/_site | |
strip_components: 2 | |
target: ~/NetCord/html | |
- name: Start Apache2 | |
if: github.ref_name == 'stable' || github.ref_name == 'alpha' | |
uses: appleboy/ssh-action@v0.1.7 | |
with: | |
username: ${{ secrets.SSH_USERNAME }} | |
host: ${{ secrets.SSH_HOST }} | |
port: ${{ secrets.SSH_PORT }} | |
key: ${{ secrets.SSH_KEY }} | |
script: sudo systemctl start apache2 |