forked from googleapis/gax-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildrelease.sh
executable file
·39 lines (29 loc) · 1.04 KB
/
buildrelease.sh
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
#!/bin/bash
# Script to perform a release build for GAX, based on
# a tag which should already have been created.
# This builds both GAX and the common protos; you should only push
# the nuget packages you actually want to update.
# Sample: buildrelease.sh Google.Api.Gax-2.1.0
# The repo is cloned into a fresh "releasebuild" directory.
set -e
if [ -z "$1" ]
then
echo Please specify the release tag
exit 1
fi
tag=$1
# TODO: We don't really want a regex here... just a match.
git fetch -v --dry-run --tags upstream 2>&1 \
| grep -e $tag > /dev/null \
|| (echo "Tag $tag appears not to exist. Did you create it?"; exit 1)
# Do everything from the repository root for sanity.
cd $(dirname $0)
rm -rf releasebuild
git clone https://github.com/googleapis/gax-dotnet.git releasebuild -c core.autocrlf=input
cd releasebuild
git checkout $tag
export CI=true # Forces SourceLink in the main build.
export NOVERSIONSUFFIX=true
./build.sh
dotnet pack Gax.sln --no-build -o $PWD/nuget -c Release
echo "Build complete. Push packages from releasebuild/nuget."