From 51e458d17c65d415dd7bb696929c106859d92623 Mon Sep 17 00:00:00 2001 From: Brad Rogers Date: Mon, 5 Oct 2020 17:39:51 -0700 Subject: [PATCH 01/21] Add documentation github action, Fix links in release note generator --- .github/workflows/documentation.yml | 29 +++++++++++++++++++++++++++++ scripts/release_note_generator.sh | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/documentation.yml diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000000..174c6bcd81 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,29 @@ +name: Documentation +on: + pull_request: + push: + branches: + - master + +jobs: + Documentation: + continue-on-error: true + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: Setup NuGet.exe + uses: nuget/setup-nuget@v1.0.2 + with: + nuget-version: latest + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v1.0.1 + - name: Restore Packages + run: nuget restore dropbox-sdk-dotnet\Dropbox.Api.sln + - name: Build Docs + run: msbuild doc\StoneDocs.shfbproj + - name: Push Documentation + uses: JamesIves/github-pages-deploy-action@releases/v3 + with: + ACCESS_TOKEN: ${{ secrets.GH_PAGES_PUBLISH_TOKEN }} + BRANCH: gh-pages # The branch the action should deploy to. + FOLDER: doc\Help # The folder the action should deploy. \ No newline at end of file diff --git a/scripts/release_note_generator.sh b/scripts/release_note_generator.sh index 4b40609d12..3cce3c02fd 100644 --- a/scripts/release_note_generator.sh +++ b/scripts/release_note_generator.sh @@ -5,5 +5,5 @@ echo "Getting commit history since $last_version" num_commits=$(git rev-list --count $last_version..HEAD) echo "Found $num_commits commits since last revision" git_log=$(git log -n $num_commits --pretty="format:* %s %n") -linked_log=$(echo "Release Notes: \n\n$git_log" | sed -e 's/#\([0-9]*\)/[#\1](github.com\/dropbox\/dropbox-sdk-dotnet\/pull\/\1)/g') +linked_log=$(echo "Release Notes: \n\n$git_log" | sed -e 's/#\([0-9]*\)/[#\1](https:\/\/github.com\/dropbox\/dropbox-sdk-dotnet\/pull\/\1)/g') echo "\n\n$linked_log" From 443779d8ddf48285c58faf980a88318151bff603 Mon Sep 17 00:00:00 2001 From: Brad Rogers Date: Mon, 5 Oct 2020 18:15:06 -0700 Subject: [PATCH 02/21] Add integration test script --- .github/workflows/documentation.yml | 2 +- scripts/integrationtest.ps1 | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 scripts/integrationtest.ps1 diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 174c6bcd81..709153453b 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -20,7 +20,7 @@ jobs: - name: Restore Packages run: nuget restore dropbox-sdk-dotnet\Dropbox.Api.sln - name: Build Docs - run: msbuild doc\StoneDocs.shfbproj + run: msbuild doc\StoneDocs.shfbproj # Follow https://ewsoftware.github.io/SHFB/html/50ad2c8c-5004-4b4c-a77f-97b8c403c9f2.htm - name: Push Documentation uses: JamesIves/github-pages-deploy-action@releases/v3 with: diff --git a/scripts/integrationtest.ps1 b/scripts/integrationtest.ps1 new file mode 100644 index 0000000000..dd234fe436 --- /dev/null +++ b/scripts/integrationtest.ps1 @@ -0,0 +1,3 @@ +msbuild "/t:Clean;Rebuild" "/verbosity:minimal" "/clp:ErrorsOnly" "/m" ".\dropbox-sdk-dotnet\Dropbox.Api\Dropbox.Api.csproj" "/p:Configuration=Debug" +msbuild "/t:Clean;Rebuild" "/verbosity:minimal" "/clp:ErrorsOnly" "/m" ".\dropbox-sdk-dotnet\Dropbox.Api.Integration.Tests\Dropbox.Api.Unit.Tests.csproj" "/p:Configuration=Debug" +vstest.console ".\dropbox-sdk-dotnet\Dropbox.Api.Unit.Tests\bin\Debug\Dropbox.Api.Integration.Tests.dll" "/Settings:dropbox-sdk-dotnet\Dropbox.Api.Integration.Tests\dropbox.runsettings" \ No newline at end of file From b58d29bda9763cd5a2b68272864326892e076ed9 Mon Sep 17 00:00:00 2001 From: Connor Worley Date: Thu, 7 Jan 2021 01:57:01 -0800 Subject: [PATCH 03/21] rework branch against new linux stuff --- .github/workflows/documentation.yml | 24 ++++++++----------- doc/StoneDocs.shfbproj | 19 ++++++++++++--- generate.py | 37 ----------------------------- scripts/integrationtest.ps1 | 3 --- 4 files changed, 26 insertions(+), 57 deletions(-) delete mode 100755 generate.py delete mode 100644 scripts/integrationtest.ps1 diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 709153453b..c90c647bb4 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,29 +1,25 @@ name: Documentation on: pull_request: - push: - branches: - - master + release: + types: [created] jobs: Documentation: - continue-on-error: true runs-on: windows-latest steps: - uses: actions/checkout@v2 - - name: Setup NuGet.exe - uses: nuget/setup-nuget@v1.0.2 + - name: Build Documentation + run: dotnet build doc/StoneDocs.shfbproj + - name: Upload Documentation + uses: actions/upload-artifact@v2 with: - nuget-version: latest - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v1.0.1 - - name: Restore Packages - run: nuget restore dropbox-sdk-dotnet\Dropbox.Api.sln - - name: Build Docs - run: msbuild doc\StoneDocs.shfbproj # Follow https://ewsoftware.github.io/SHFB/html/50ad2c8c-5004-4b4c-a77f-97b8c403c9f2.htm + name: Documentation + path: doc\Help - name: Push Documentation uses: JamesIves/github-pages-deploy-action@releases/v3 + if: github.event_name == 'release' with: ACCESS_TOKEN: ${{ secrets.GH_PAGES_PUBLISH_TOKEN }} BRANCH: gh-pages # The branch the action should deploy to. - FOLDER: doc\Help # The folder the action should deploy. \ No newline at end of file + FOLDER: doc\Help # The folder the action should deploy. diff --git a/doc/StoneDocs.shfbproj b/doc/StoneDocs.shfbproj index 59b1cb364c..2099a757f5 100644 --- a/doc/StoneDocs.shfbproj +++ b/doc/StoneDocs.shfbproj @@ -90,6 +90,19 @@ del Help\Web* /Q - - - \ No newline at end of file + + + + + + + + + + + + diff --git a/generate.py b/generate.py deleted file mode 100755 index 6b075bfe33..0000000000 --- a/generate.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python -from __future__ import absolute_import, division, print_function - -import glob -import os -import shutil -import subprocess - - -def main(): - """The entry point for the program.""" - stone_path = os.path.abspath('stone') - print(stone_path) - generator_path = os.path.abspath('generator') - print(generator_path) - spec_path = os.path.abspath('spec') - print(spec_path) - specs = glob.glob(spec_path + '/*.stone') # Arbitrary sorting - specs.sort() - print(specs) - - repo_path = os.path.abspath('dropbox-sdk-dotnet') - print('Generating Stone types') - try: - shutil.rmtree(os.path.join(repo_path, 'Dropbox.Api', 'Generated')) - except OSError: - pass - try: - subprocess.check_output( - (['python', '-m', 'stone.cli', '--filter-by-route-attr', 'alpah_group=null', '-a:all', generator_path + '/csharp.stoneg.py'] + - [os.path.join(repo_path, 'Dropbox.Api')] + specs), - cwd=stone_path) - except subprocess.CalledProcessError as e: - print(e.output) - -if __name__ == '__main__': - main() diff --git a/scripts/integrationtest.ps1 b/scripts/integrationtest.ps1 deleted file mode 100644 index dd234fe436..0000000000 --- a/scripts/integrationtest.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -msbuild "/t:Clean;Rebuild" "/verbosity:minimal" "/clp:ErrorsOnly" "/m" ".\dropbox-sdk-dotnet\Dropbox.Api\Dropbox.Api.csproj" "/p:Configuration=Debug" -msbuild "/t:Clean;Rebuild" "/verbosity:minimal" "/clp:ErrorsOnly" "/m" ".\dropbox-sdk-dotnet\Dropbox.Api.Integration.Tests\Dropbox.Api.Unit.Tests.csproj" "/p:Configuration=Debug" -vstest.console ".\dropbox-sdk-dotnet\Dropbox.Api.Unit.Tests\bin\Debug\Dropbox.Api.Integration.Tests.dll" "/Settings:dropbox-sdk-dotnet\Dropbox.Api.Integration.Tests\dropbox.runsettings" \ No newline at end of file From 33fd2c1d0d8d7ff4df41f05c637bdca0fa3da16c Mon Sep 17 00:00:00 2001 From: Connor Worley Date: Thu, 7 Jan 2021 02:02:30 -0800 Subject: [PATCH 04/21] Add SHFB PackageReference --- doc/StoneDocs.shfbproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/StoneDocs.shfbproj b/doc/StoneDocs.shfbproj index 2099a757f5..7fa481d819 100644 --- a/doc/StoneDocs.shfbproj +++ b/doc/StoneDocs.shfbproj @@ -96,6 +96,10 @@ del Help\Web* /Q + + + + Date: Thu, 7 Jan 2021 02:09:23 -0800 Subject: [PATCH 05/21] Try referencing Microsoft.WindowsDesktop.App framework --- doc/StoneDocs.shfbproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/StoneDocs.shfbproj b/doc/StoneDocs.shfbproj index 7fa481d819..134e8974e5 100644 --- a/doc/StoneDocs.shfbproj +++ b/doc/StoneDocs.shfbproj @@ -98,6 +98,8 @@ del Help\Web* /Q + + - - .NET Framework 4.5 - .\Help\ + Cross-platform (.NET Core/.NET Standard) + ./Help/ DotNetApiDocumentation en-US - - - - + + + + OnlyWarningsAndErrors Website False @@ -55,10 +55,10 @@ - rmdir Help\toc /S /Q -rmdir Help\fti /S /Q -del Help\Search* /Q -del Help\Web* /Q + rmdir Help/toc /S /Q +rmdir Help/fti /S /Q +del Help/Search* /Q +del Help/Web* /Q OnBuildSuccess - + + - - From 57a672c1dfedc0eacbacc567d381ea9f60e51df1 Mon Sep 17 00:00:00 2001 From: Connor Worley Date: Thu, 7 Jan 2021 02:44:12 -0800 Subject: [PATCH 12/21] directly use Dropbox.Api.csproj as a documentation source --- .github/workflows/documentation.yml | 7 +++---- doc/StoneDocs.shfbproj | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 7d2b4cef9e..8083aabda2 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -11,12 +11,11 @@ jobs: - uses: actions/checkout@v2 - name: Setup MSBuild uses: microsoft/setup-msbuild@v1.0.2 - - name: Build SDK - run: | - dotnet build dropbox-sdk-dotnet/Dropbox.Api --configuration Release - name: Build Documentation run: | - msbuild doc/StoneDocs.shfbproj /t:Restore + dotnet restore dropbox-sdk-dotnet/Dropbox.Api + dotnet restore doc/StoneDocs.shfbproj + # We have to use msbuild when actually generating the docs for WinForms to work. msbuild doc/StoneDocs.shfbproj - name: Upload Documentation uses: actions/upload-artifact@v2 diff --git a/doc/StoneDocs.shfbproj b/doc/StoneDocs.shfbproj index f27886d86c..48081ad6a5 100644 --- a/doc/StoneDocs.shfbproj +++ b/doc/StoneDocs.shfbproj @@ -18,8 +18,8 @@ DotNetApiDocumentation en-US + - OnlyWarningsAndErrors From 4629cb281e6af50647875b78c102b35912688600 Mon Sep 17 00:00:00 2001 From: Connor Worley Date: Thu, 7 Jan 2021 02:47:14 -0800 Subject: [PATCH 13/21] Manually build SDK before building docs --- .github/workflows/documentation.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 8083aabda2..dd1a6b2b34 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -11,9 +11,11 @@ jobs: - uses: actions/checkout@v2 - name: Setup MSBuild uses: microsoft/setup-msbuild@v1.0.2 + - name: Build SDK + run: | + dotnet build dropbox-sdk-dotnet/Dropbox.Api - name: Build Documentation run: | - dotnet restore dropbox-sdk-dotnet/Dropbox.Api dotnet restore doc/StoneDocs.shfbproj # We have to use msbuild when actually generating the docs for WinForms to work. msbuild doc/StoneDocs.shfbproj From 37e9f79b6f9b42edb31eb3d29377c25c5aa69071 Mon Sep 17 00:00:00 2001 From: Connor Worley Date: Thu, 7 Jan 2021 02:55:16 -0800 Subject: [PATCH 14/21] Try enabling and building with dotnet --- .github/workflows/documentation.yml | 9 +-------- doc/StoneDocs.shfbproj | 2 ++ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index dd1a6b2b34..254564cf5f 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -9,16 +9,9 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v2 - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v1.0.2 - - name: Build SDK - run: | - dotnet build dropbox-sdk-dotnet/Dropbox.Api - name: Build Documentation run: | - dotnet restore doc/StoneDocs.shfbproj - # We have to use msbuild when actually generating the docs for WinForms to work. - msbuild doc/StoneDocs.shfbproj + dotnet build doc/StoneDocs.shfbproj - name: Upload Documentation uses: actions/upload-artifact@v2 with: diff --git a/doc/StoneDocs.shfbproj b/doc/StoneDocs.shfbproj index 48081ad6a5..202943f06c 100644 --- a/doc/StoneDocs.shfbproj +++ b/doc/StoneDocs.shfbproj @@ -7,6 +7,7 @@ AnyCPU 2.0 {1e44f241-ec24-4d32-8837-868cbe134f98} + true 2017.9.26.0 Documentation @@ -99,6 +100,7 @@ del Help/Web* /Q + From 291cda0453dd8df5118f13966bc99604f593524e Mon Sep 17 00:00:00 2001 From: Connor Worley Date: Thu, 7 Jan 2021 03:06:26 -0800 Subject: [PATCH 17/21] go back to building SDK manually --- .github/workflows/documentation.yml | 3 +++ doc/StoneDocs.shfbproj | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 254564cf5f..d4e319d123 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -9,6 +9,9 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v2 + - name: Build SDK + run: | + dotnet build dropbox-sdk-dotnet/Dropbox.Api - name: Build Documentation run: | dotnet build doc/StoneDocs.shfbproj diff --git a/doc/StoneDocs.shfbproj b/doc/StoneDocs.shfbproj index cd56f306bd..2f044e818c 100644 --- a/doc/StoneDocs.shfbproj +++ b/doc/StoneDocs.shfbproj @@ -7,7 +7,6 @@ AnyCPU 2.0 {1e44f241-ec24-4d32-8837-868cbe134f98} - net5.0 true 2017.9.26.0 @@ -103,7 +102,6 @@ - Documentation From 3c33b4c2572eebf472cae14e6760098d636d2c0e Mon Sep 17 00:00:00 2001 From: Connor Worley Date: Thu, 7 Jan 2021 03:28:32 -0800 Subject: [PATCH 19/21] tar before uploading doc artifact --- .github/workflows/documentation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 27fe3823d0..04ca8dee79 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -18,11 +18,11 @@ jobs: run: | dotnet restore doc/StoneDocs.shfbproj msbuild doc/StoneDocs.shfbproj # WinForms refuse to work with .NET 5.0 + tar -cvzf doc/Help.tar.gz doc/Help - name: Upload Documentation uses: actions/upload-artifact@v2 with: - name: Documentation - path: doc/Help + path: doc/Help.tar.gz - name: Push Documentation uses: JamesIves/github-pages-deploy-action@releases/v3 if: github.event_name == 'release' From 8d0d1d555d551e1b77db093a0561ee94c0d0eb64 Mon Sep 17 00:00:00 2001 From: Connor Worley Date: Thu, 7 Jan 2021 03:48:43 -0800 Subject: [PATCH 20/21] Add workflow steps for attaching docs to releases --- .github/workflows/documentation.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 04ca8dee79..a5d841e13c 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -18,11 +18,29 @@ jobs: run: | dotnet restore doc/StoneDocs.shfbproj msbuild doc/StoneDocs.shfbproj # WinForms refuse to work with .NET 5.0 - tar -cvzf doc/Help.tar.gz doc/Help + tar -czf doc/Help.tar.gz doc/Help/* - name: Upload Documentation uses: actions/upload-artifact@v2 with: + name: documentation.tar.gz path: doc/Help.tar.gz + retention-days: 1 + - name: Get Release Information + id: get_release + uses: bruceadams/get-release@v1.2.2 + if: github.event_name == 'release' + env: + GITHUB_TOKEN: ${{ github.token }} + - name: Attach Documentation to Relase + uses: actions/upload-release-asset@v1.0.2 + if: github.event_name == 'release' + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: doc/Help.tar.gz + asset_name: documentation.tar.gz + asset_content_type: application/gzip - name: Push Documentation uses: JamesIves/github-pages-deploy-action@releases/v3 if: github.event_name == 'release' From a4ffb91e01de809bcbe3ba8cd2ca6f23be00a0ef Mon Sep 17 00:00:00 2001 From: Connor Worley Date: Thu, 7 Jan 2021 04:01:13 -0800 Subject: [PATCH 21/21] strip leading directories from tar --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index a5d841e13c..1182ff1024 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -18,7 +18,7 @@ jobs: run: | dotnet restore doc/StoneDocs.shfbproj msbuild doc/StoneDocs.shfbproj # WinForms refuse to work with .NET 5.0 - tar -czf doc/Help.tar.gz doc/Help/* + tar -czf doc/Help.tar.gz -C doc/Help . - name: Upload Documentation uses: actions/upload-artifact@v2 with: