Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
c43f7188
Commit
c43f7188
authored
8 years ago
by
Feng Xiao
Committed by
GitHub
8 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1846 from xfxyjwf/zip
Add a script to build protoc zip packages.
parents
b1cecb67
b553b87b
master
v3.11.4
v3.11.3
v3.11.2
v3.11.1
v3.11.0
v3.11.0-rc2
v3.11.0-rc1
v3.10.1
v3.10.0
v3.10.0-rc1
v3.9.2
v3.9.1
v3.9.0
v3.9.0-rc1
v3.8.0
v3.8.0-rc1
v3.7.1
v3.7.0
v3.7.0rc2
v3.7.0rc1
v3.7.0-rc.3
v3.7.0-rc.2
v3.6.1.3
v3.6.1.2
v3.6.1.1
v3.6.1
v3.6.0.1
v3.6.0
v3.6.0rc2
v3.6.0rc1
v3.5.2
v3.5.1.1
v3.5.1
v3.5.0.1
v3.5.0
v3.4.1
v3.4.0
v3.4.0rc3
v3.4.0rc2
v3.4.0rc1
v3.3.2
v3.3.1
v3.3.0
v3.3.0rc1
v3.2.1
v3.2.0
v3.2.0rc2
v3.2.0-rc.1
v3.2.0-alpha-1
v3.1.0
v3.1.0-alpha-1
v3.0.2
v3.0.0
conformance-build-tag
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
113 additions
and
0 deletions
+113
-0
README.md
protoc-artifacts/README.md
+19
-0
build-zip.sh
protoc-artifacts/build-zip.sh
+94
-0
No files found.
protoc-artifacts/README.md
View file @
c43f7188
...
...
@@ -102,6 +102,25 @@ When you have done deployment for all platforms, go to
https://oss.sonatype.org/#stagingRepositories, verify that the staging
repository has all the binaries, close and release this repository.
## Upload zip packages to github release page.
After uploading protoc artifacts to Maven Central repository, run the
build-zip.sh script to bulid zip packages for these protoc binaries
and upload these zip packages to the download section of the github
release. For example:
```
$ ./build-zip.sh 3.0.0-beta-4
```
The above command will create 5 zip files:
```
dist/protoc-3.0.0-beta-4-win32.zip
dist/protoc-3.0.0-beta-4-osx-x86_32.zip
dist/protoc-3.0.0-beta-4-osx-x86_64.zip
dist/protoc-3.0.0-beta-4-linux-x86_32.zip
dist/protoc-3.0.0-beta-4-linux-x86_64.zip
```
Before running the script, make sure the artifacts are accessible from:
http://repo1.maven.org/maven2/com/google/protobuf/protoc/
### Tips for deploying on Linux
We build on Centos 6.6 to provide a good compatibility for not very new
systems. We have provided a
``Dockerfile``
under this directory to build the
...
...
This diff is collapsed.
Click to expand it.
protoc-artifacts/build-zip.sh
0 → 100755
View file @
c43f7188
#!/bin/bash
if
[
$#
-eq
0
]
;
then
cat
<<
EOF
Usage:
$0
<VERSION_NUMBER>
Example:
$ $0
3.0.0-beta-4
This script will download pre-built protoc binaries from maven repository
and package them with well-known type .proto files to create .zip packages
suitable to be included in the github release page. Each invocation will
create 5 zip packages:
dist/protoc-<VERSION_NUMBER>-win32.zip
dist/protoc-<VERSION_NUMBER>-osx-x86_32.zip
dist/protoc-<VERSION_NUMBER>-osx-x86_64.zip
dist/protoc-<VERSION_NUMBER>-linux-x86_32.zip
dist/protoc-<VERSION_NUMBER>-linux-x86_64.zip
EOF
exit
1
fi
VERSION_NUMBER
=
$1
# <zip file name> <binary file name> pairs.
declare
-a
FILE_NAMES
=(
\
win32.zip windows-x86_32.exe
\
osx-x86_32.zip osx-x86_32.exe
\
osx-x86_64.zip osx-x86_64.exe
\
linux-x86_32.zip linux-x86_32.exe
\
linux-x86_64.zip linux-x86_64.exe
\
)
# List of all well-known types to be included.
declare
-a
WELL_KNOWN_TYPES
=(
\
google/protobuf/descriptor.proto
\
google/protobuf/any.proto
\
google/protobuf/api.proto
\
google/protobuf/duration.proto
\
google/protobuf/empty.proto
\
google/protobuf/field_mask.proto
\
google/protobuf/source_context.proto
\
google/protobuf/struct.proto
\
google/protobuf/timestamp.proto
\
google/protobuf/type.proto
\
google/protobuf/wrappers.proto
\
google/protobuf/compiler/plugin.proto
\
)
set
-e
# A temporary working directory to put all files.
DIR
=
$(
mktemp
-d
)
# Copy over well-known types.
mkdir
-p
${
DIR
}
/include/google/protobuf/compiler
for
PROTO
in
${
WELL_KNOWN_TYPES
[@]
}
;
do
cp
-f
../src/
${
PROTO
}
${
DIR
}
/include/
${
PROTO
}
done
# Create a readme file.
cat
<<
EOF
>
${
DIR
}
/readme.txt
Protocol Buffers - Google's data interchange format
Copyright 2008 Google Inc.
https://developers.google.com/protocol-buffers/
This package contains a precompiled binary version of the protocol buffer
compiler (protoc). This binary is intended for users who want to use Protocol
Buffers in languages other than C++ but do not want to compile protoc
themselves. To install, simply place this binary somewhere in your PATH.
Please refer to our official github site for more installation instructions:
https://github.com/google/protobuf
EOF
mkdir
-p
dist
mkdir
-p
${
DIR
}
/bin
# Create a zip file for each binary.
for
((
i
=
0
;
i<
${#
FILE_NAMES
[@]
}
;
i+
=
2
))
;
do
ZIP_NAME
=
${
FILE_NAMES
[
$i
]
}
BINARY_NAME
=
${
FILE_NAMES
[
$((
$i
+
1
))
]
}
BINARY_URL
=
http://repo1.maven.org/maven2/com/google/protobuf/protoc/
${
VERSION_NUMBER
}
/protoc-
${
VERSION_NUMBER
}
-
${
BINARY_NAME
}
if
!
wget
${
BINARY_URL
}
-O
${
DIR
}
/bin/protoc &> /dev/null
;
then
echo
"[ERROR] Failed to download
${
BINARY_URL
}
"
>
&2
echo
"[ERROR] Skipped protoc-
${
VERSION_NAME
}
-
${
ZIP_NAME
}
"
>
&2
continue
fi
TARGET_ZIP_FILE
=
`
pwd
`
/dist/protoc-
${
VERSION_NUMBER
}
-
${
ZIP_NAME
}
pushd
$DIR
&> /dev/null
chmod
+x bin/protoc
zip
-r
${
TARGET_ZIP_FILE
}
include bin readme.txt &> /dev/null
popd
&> /dev/null
echo
"[INFO] Successfully created
${
TARGET_ZIP_FILE
}
"
done
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment