diff --git a/.github/workflows/build-commit.yml b/.github/workflows/build-commit.yml index 877f676..f2bd24d 100644 --- a/.github/workflows/build-commit.yml +++ b/.github/workflows/build-commit.yml @@ -5,6 +5,7 @@ on: paths: - ".github/workflows/build-commit.yml" - "src/**" + - "tests/**" - "*.sln" workflow_dispatch: @@ -15,38 +16,57 @@ env: DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 jobs: - build: - name: Build + build-commit: + name: Build Commit runs-on: ubuntu-latest - if: "!contains(format('{0} {1}', github.event.head_commit.message), '[ci-skip]')" + if: "!contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[ci-skip]')" steps: - name: Checkout uses: actions/checkout@v3 with: - submodules: 'recursive' - fetch-depth: '0' + submodules: recursive + fetch-depth: 0 - name: Setup .NET uses: actions/setup-dotnet@v3 with: dotnet-version: 8 - - name: Test - run: dotnet test --blame --blame-hang-timeout=30s - - name: Package - run: dotnet pack -c Release -o build -p:Nightly=$(printf "%0*d" 5 ${{ github.run_number }}) src/OoLunar.DSharpPlus.CommandAll.csproj - - name: Upload Artifact - uses: actions/upload-artifact@v3 + - name: Build Project + run: dotnet build + test-commit: + name: Test Commit + runs-on: ubuntu-latest + needs: build-commit + steps: + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8 + - name: Test Project + run: dotnet test --blame-hang --blame-hang-dump-type mini --blame-hang-timeout 30s + document-commit: + name: Document Commit + runs-on: ubuntu-latest + needs: test-commit + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Setup .NET + uses: actions/setup-dotnet@v3 with: - name: DSharpPlus.CommandAll-Nightly-${{ github.run_number }}∕${{ github.run_attempt }}.zip - path: ./build/* - - name: Publish Nightly Nuget Packages + dotnet-version: 8 + - name: Build Project run: | - dotnet nuget push "build/*" --skip-duplicate -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json - echo LATEST_STABLE_VERSION=$(git describe --abbrev=0 --tags 2>/dev/null || echo '') >> $GITHUB_ENV - dotnet run --project ./tools/AutoUpdateChannelDescription --framework=net8.0 -p:Nightly=$(printf "%0*d" 5 ${{ github.run_number }}) - env: - DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }} - DISCORD_GUILD_ID: ${{ secrets.DISCORD_GUILD_ID }} - DISCORD_CHANNEL_ID: ${{ secrets.DISCORD_CHANNEL_ID }} - DISCORD_CHANNEL_TOPIC: ${{ secrets.DISCORD_CHANNEL_TOPIC }} - NUGET_URL: ${{ secrets.NUGET_URL }} - GITHUB_URL: ${{ github.server_url }}/${{ github.repository }} + dotnet build + dotnet tool update -g docfx --prerelease + docfx docs/docfx.json + - name: Upload GitHub Pages artifact + uses: actions/upload-pages-artifact@v1 + with: + path: ./docs/_site/ + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 \ No newline at end of file