Skip to content

Commit

Permalink
chore: Migrate from Python to .NET for uploading documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jskeet committed Sep 4, 2023
1 parent 4191640 commit 8f14ebf
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 521 deletions.
6 changes: 6 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
"commands": [
"docfx"
]
},
"Google.Cloud.Tools.DocUploader": {
"version": "0.2.1",
"commands": [
"docuploader"
]
}
}
}
25 changes: 0 additions & 25 deletions .kokoro/README.md

This file was deleted.

8 changes: 3 additions & 5 deletions .kokoro/UploadGeneratedDocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ then
exit 1
fi

# Make sure we have the most recent version of pip, then install other packages.
python -m pip install --require-hashes -r pip-requirements.txt
python -m pip install --require-hashes -r requirements.txt
dotnet tool restore > /dev/null

declare -r service_account_json=$(realpath $1)
declare -r staging_bucket=$2
Expand All @@ -30,8 +28,8 @@ do
version=$(grep \<Version\> Src/Generated/$pkg/$pkg.csproj | sed 's/</>/g' | cut -d\> -f 3)
pushd Src/Generated/$pkg/obj/site > /dev/null
echo "Uploading $pkg version $version"
python -m docuploader create-metadata --name $pkg --version $version --language dotnet --github-repository googleapis/google-api-dotnet-client
python -m docuploader upload . --credentials $service_account_json --staging-bucket $staging_bucket
dotnet docuploader create-metadata --name $pkg --version $version --language dotnet --github-repository googleapis/google-api-dotnet-client
dotnet docuploader upload --documentation-path . --credentials $service_account_json --staging-bucket $staging_bucket
popd > /dev/null
fi
done
8 changes: 3 additions & 5 deletions .kokoro/UploadSupportDocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ then
exit 1
fi

# Make sure we have the most recent version of pip, then install other packages.
python -m pip install --require-hashes -r pip-requirements.txt
python -m pip install --require-hashes -r requirements.txt
dotnet tool restore > /dev/null

declare -r service_account_json=$(realpath $1)
declare -r staging_bucket=$2
Expand All @@ -28,9 +26,9 @@ for pkg in $packages
do
pushd Src/Support/$pkg/obj/site
echo "Generating metadata for $pkg"
python -m docuploader create-metadata --name $pkg --version $version --language dotnet --github-repository googleapis/google-api-dotnet-client
dotnet docuploader create-metadata --name $pkg --version $version --language dotnet --github-repository googleapis/google-api-dotnet-client

echo "Final upload stage"
python -m docuploader upload . --credentials $service_account_json --staging-bucket $staging_bucket
dotnet docuploader upload --documentation-path . --credentials $service_account_json --staging-bucket $staging_bucket
popd > /dev/null
done
2 changes: 0 additions & 2 deletions .kokoro/pip-requirements.txt

This file was deleted.

Loading

0 comments on commit 8f14ebf

Please sign in to comment.