forked from googleapis/google-cloud-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildrelease.sh
More file actions
executable file
·61 lines (47 loc) · 1.64 KB
/
buildrelease.sh
File metadata and controls
executable file
·61 lines (47 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# Script to perform a release build for all APIs tagged at
# a specific commit. A single argument is required: the commit to use.
# The repo is cloned into a fresh "releasebuild" directory.
set -e
if [ -z "$1" ]
then
echo "Please specify a commit hash"
exit 1
fi
commit=$1
# Do everything from the repository root for sanity.
cd $(dirname $0)
rm -rf releasebuild
git clone https://github.com/GoogleCloudPlatform/google-cloud-dotnet.git releasebuild -c core.autocrlf=input
cd releasebuild
export CI=true # Forces SourceLink in the main build.
git checkout $commit
# Turn the multi-line output of git tag --points-at into space-separated list of projects
projects=$(git tag --points-at $commit | sed 's/-.*//g' | awk -vORS=\ '{print $1}' | sed 's/ $//')
if [ -z "$projects" ]
then
echo "No tags found for commit $commit"
exit 1
fi
./build.sh $projects
./runintegrationtests.sh $projects
for project in $projects
do
# Don't pack the whole solution - just the project. (Avoids packing dependent
# projects such as Google.LongRunning.)
dotnet pack --no-build --no-restore -o $PWD/nuget -c Release apis/$project/$project
done
# TODO: Make builddocs.sh cope with being run from any directory.
cd docs
./builddocs.sh root $projects
echo "Release build complete for the following projects:"
for project in $projects
do
echo "- ${project}"
done
echo "Next steps:"
echo "- Upload new docs to gh-pages branch"
echo "- Push packages to nuget:"
echo " - cd releasebuild/nuget"
echo " - Remove any packages you don't want to push"
echo " - for pkg in *.nupkg; do dotnet nuget push -s https://api.nuget.org/v3/index.json -k API_KEY_HERE \$pkg; done"