diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 09b79de91..1b5f63f05 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,37 +1,37 @@ name: "Build Library" on: push: branches: - main pull_request: merge_group: workflow_dispatch: env: DOTNET_NOLOGO: true DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true DOTNET_CLI_TELEMETRY_OPTOUT: true DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: true jobs: build: timeout-minutes: 15 strategy: matrix: os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} name: Build library steps: - name: Checkout repository uses: actions/checkout@v3 - name: Setup .NET - uses: actions/setup-dotnet@v3.1.0 + uses: actions/setup-dotnet@v3.2.0 with: dotnet-version: | 7.0.203 6.x - name: Build library run: dotnet build -c Release -v normal DisCatSharp.sln - name: Test library run: dotnet test -v normal -c Release --no-restore --no-build DisCatSharp.sln diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index d885ca91b..ebf2e857f 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,113 +1,113 @@ name: "Documentation" on: workflow_dispatch: env: DOTNET_NOLOGO: true DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true DOTNET_CLI_TELEMETRY_OPTOUT: true DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: true jobs: build: timeout-minutes: 25 runs-on: ubuntu-latest name: Build documentation steps: - name: Checkout repository uses: actions/checkout@v3 with: token: ${{ secrets.NYUW_TOKEN_GH }} - name: Setup .NET - uses: actions/setup-dotnet@v3.1.0 + uses: actions/setup-dotnet@v3.2.0 with: dotnet-version: 7.0.203 - name: Git fetch unshallow run: git fetch --unshallow - name: Install DocFX run: dotnet tool update -g docfx --prerelease - name: Restore packages run: dotnet restore DisCatSharp.sln - name: Build library run: dotnet build -c Release --no-restore -v minimal -f net7.0 DisCatSharp.sln timeout-minutes: 7 continue-on-error: true #- name: Add Custom Plugins # run: cp -R DisCatSharp.Docs/dcs/plugins/* /home/runner/.dotnet/tools/.store/docfx/2.67.0/docfx/2.67.0/tools/net7.0/any/ - name: Build Docs run: docfx DisCatSharp.Docs/docfx.json - name: Pack Docs shell: pwsh run: ./DisCatSharp.Tools/pack-docs.ps1 -DocsPath "./DisCatSharp.Docs" -OutputPath "./" -PackageName "dcs-docs" - name: Upload packed docs uses: actions/upload-artifact@v3 with: name: dcs-docs.zip path: dcs-docs.zip retention-days: 30 # - name: Force add build files # run: git add DisCatSharp.Docs/obj/.cache/build/* -f # - name: Commit and push changes # uses: EndBug/add-and-commit@main # with: # default_author: user_info # author_name: NyuwBot # author_email: nyuw@aitsys.dev # committer_name: NyuwBot # committer_email: nyuw@aitsys.dev # commit: --signoff # message: '[ci skip] Sync docs changes' # tag_push: '--force' documentation: runs-on: ubuntu-latest name: Upload documentation needs: build steps: - name: Checkout docs repository uses: actions/checkout@v3 with: repository: Aiko-IT-Systems/DisCatSharp.Docs token: ${{ secrets.NYUW_TOKEN_GH }} - name: Purge old docs shell: pwsh run: Get-ChildItem -Exclude .git* | Remove-Item -Recurse -Force - name: Download packed docs uses: actions/download-artifact@v3 with: name: dcs-docs.zip - name: Extract new docs run: unzip dcs-docs.zip -d . - name: Deleze zip run: rm dcs-docs.zip - name: Delete packed docs uses: geekyeggo/delete-artifact@v2 with: name: dcs-docs.zip - name: Add .htaccess run: rm -f .htaccess && wget https://gist.githubusercontent.com/Lulalaby/8a032d0ddebb9125691094edc67b6593/raw/0c4bf0423cfe334fdd5092b014d2481759dd052a/.htaccess #- name: Add _redirects # run: rm -f _redirects && wget https://gist.githubusercontent.com/Lulalaby/0c784680a855fd161411002e3859b4fd/raw/9708d1acfce3f647cbb8da19c2022a20198979fa/_redirects - name: Set access rights run: sudo chmod 777 -R . - name: Commit and push changes uses: EndBug/add-and-commit@main with: default_author: user_info author_name: NyuwBot author_email: nyuw@aitsys.dev committer_name: NyuwBot committer_email: nyuw@aitsys.dev commit: --signoff message: 'Docs update (https://github.com/${{github.repository}}/commit/${{github.sha}})' publish-backup: runs-on: ubuntu-latest name: Publish documentation on backup server needs: documentation steps: - name: Get SSH Agent uses: webfactory/ssh-agent@v0.8.0 with: ssh-private-key: ${{ secrets.AITSYS_SSH }} - name: Publish on server continue-on-error: true run: ssh -o StrictHostKeyChecking=no -T root@207.180.240.241 -f 'cd /var/www/dcsdocs && git pull -f && service apache2 restart' diff --git a/.github/workflows/documentation_test.yml b/.github/workflows/documentation_test.yml index e52bf6638..1a8b4ac17 100644 --- a/.github/workflows/documentation_test.yml +++ b/.github/workflows/documentation_test.yml @@ -1,104 +1,104 @@ name: "Test Documentation" on: pull_request: branches: - main env: DOTNET_NOLOGO: true DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true DOTNET_CLI_TELEMETRY_OPTOUT: true DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: true jobs: build: timeout-minutes: 20 runs-on: ubuntu-latest name: Build documentation steps: - name: Checkout repository uses: actions/checkout@v3 with: token: ${{ secrets.NYUW_TOKEN_GH }} - name: Setup .NET - uses: actions/setup-dotnet@v3.1.0 + uses: actions/setup-dotnet@v3.2.0 with: dotnet-version: 7.0.203 - name: Install DocFX run: dotnet tool update -g docfx --prerelease continue-on-error: true - name: Restore packages run: dotnet restore DisCatSharp.sln - name: Build library run: dotnet build -c Release -v minimal -f net7.0 --no-restore DisCatSharp.sln timeout-minutes: 7 continue-on-error: true #- name: Add Custom Plugins # run: cp -R DisCatSharp.Docs/dcs/plugins/* /home/runner/.dotnet/tools/.store/docfx/2.67.0/docfx/2.67.0/tools/net7.0/any/ - name: Build Docs run: docfx DisCatSharp.Docs/docfx.json - name: Pack Docs shell: pwsh run: ./DisCatSharp.Tools/pack-docs.ps1 -DocsPath "./DisCatSharp.Docs" -OutputPath "./" -PackageName "dcs-docs-preview" - name: Upload packed docs uses: actions/upload-artifact@v3 with: name: dcs-docs-preview.zip path: dcs-docs-preview.zip retention-days: 2 test_documentation: runs-on: ubuntu-latest name: Test documentation needs: build steps: - name: Dynamically create branch uses: GuillaumeFalourd/create-other-repo-branch-action@v1.5 with: repository_owner: Aiko-IT-Systems repository_name: DisCatSharp.Docs new_branch_name: ${{ github.head_ref }} access_token: ${{ secrets.NYUW_TOKEN_GH }} ignore_branch_exists: true git_user_name: NyuwBot git_user_email: nyuw@aitsys.dev - name: Checkout docs repository uses: actions/checkout@v3 with: repository: Aiko-IT-Systems/DisCatSharp.Docs token: ${{ secrets.NYUW_TOKEN_GH }} ref: ${{ github.head_ref }} - name: Purge old docs shell: pwsh run: Get-ChildItem -Exclude .git* | Remove-Item -Recurse -Force - name: Download packed docs uses: actions/download-artifact@v3 with: name: dcs-docs-preview.zip - name: Extract new docs run: unzip dcs-docs-preview.zip -d . - name: Deleze zip run: rm dcs-docs-preview.zip - name: Add .htaccess run: rm -f .htaccess && wget https://gist.githubusercontent.com/Lulalaby/8a032d0ddebb9125691094edc67b6593/raw/0c4bf0423cfe334fdd5092b014d2481759dd052a/.htaccess #- name: Add _redirects # run: rm -f _redirects && wget https://gist.githubusercontent.com/Lulalaby/0c784680a855fd161411002e3859b4fd/raw/9708d1acfce3f647cbb8da19c2022a20198979fa/_redirects - name: Set access rights run: sudo chmod 777 -R . - name: Commit changes run: | git config user.name NyuwBot git config user.email nyuw@aitsys.dev git add . git commit -m "Test-Docs update (https://github.com/${{github.repository}}/commit/${{github.sha}})" git push -f - name: Add PR Comment if: always() uses: mshick/add-pr-comment@v2 with: refresh-message-position: true message-success: | Documentation test build passed! :tada: Visit the cloudflare action run in https://github.com/Aiko-IT-Systems/DisCatSharp.Docs/commits/${{github.head_ref}} for details :3 ![gif](https://media.tenor.com/3PjRNS8paykAAAAC/pat-pat-head.gif) message-failure: "Documentation test build failed! :x:" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4b54110cf..d00116ade 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,56 +1,56 @@ name: "Release DisCatSharp" on: workflow_dispatch: inputs: version_suffix: description: "Version Suffix" required: false type: string release_as_prerelease: description: "Release as pre-release" required: true type: boolean env: DOTNET_NOLOGO: true DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true DOTNET_CLI_TELEMETRY_OPTOUT: true DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: true jobs: release: timeout-minutes: 15 runs-on: windows-latest name: Build library and release steps: - name: Checkout repository uses: actions/checkout@v3 - name: Setup .NET - uses: actions/setup-dotnet@v3.1.0 + uses: actions/setup-dotnet@v3.2.0 with: dotnet-version: | 7.0.203 6.x - name: Restore dependencies run: dotnet restore DisCatSharp.sln - name: Build library as full release if: ${{!inputs.release_as_prerelease}} shell: pwsh run: ./DisCatSharp.Tools/rebuild-lib.ps1 -ArtifactLocation ./dcs-artifacts -Configuration Release - name: Build library as pre-release if: ${{inputs.release_as_prerelease}} shell: pwsh run: ./DisCatSharp.Tools/rebuild-lib.ps1 -ArtifactLocation ./dcs-artifacts -Configuration Release -VersionSuffix ${{github.event.inputs.version_suffix}} - name: Remove invalid packages shell: pwsh run: rm *.symbols.* working-directory: ./dcs-artifacts - name: Publish to NuGet shell: pwsh run: dotnet nuget push --source https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} * --skip-duplicate working-directory: ./dcs-artifacts - name: Publish to GitHub Packages shell: pwsh run: dotnet nuget push --source https://nuget.pkg.github.com/Aiko-IT-Systems/index.json -k ${{secrets.NYUW_TOKEN_GH}} * working-directory: ./dcs-artifacts