-
-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gpu-dawn: CI: upload headers.json + tarball
- Loading branch information
Showing
5 changed files
with
69 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
set -exuo pipefail | ||
cd "$(dirname "${BASH_SOURCE[0]}")"/.. | ||
|
||
# Prepare the `out/` directory that we will bundle. | ||
rm -rf out/ | ||
mkdir out/ | ||
cp -R libs/dawn/include out/ | ||
cp -R libs/dawn/out/Debug/gen/include/* out/include/ | ||
cp libs/dawn/LICENSE out/ | ||
|
||
# Bundle headers.json.gz | ||
pushd out | ||
python ../dev/dir_to_json.py > ../headers.json | ||
popd | ||
gzip -9 headers.json | ||
|
||
# Copy the binary into the out/ directory | ||
cp zig-out/lib/libdawn.a out/ | ||
|
||
# Create out.tar.gz bundle | ||
pushd out | ||
tar -czvf ../out.tar.gz . | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import os | ||
import json | ||
|
||
def dir_to_dict(d): | ||
dict = {} | ||
for dirpath,_,filenames in os.walk(d): | ||
for f in filenames: | ||
path = os.path.join(dirpath, f) | ||
dict[path] = open(path, 'r').read() | ||
return dict | ||
|
||
print(json.dumps(dir_to_dict('.'))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
set -exuo pipefail | ||
cd "$(dirname "${BASH_SOURCE[0]}")"/.. | ||
|
||
# Prepare tarball, headers.json.gz, etc. | ||
./dev/bundle-release.sh | ||
|
||
if [[ "${UPLOAD_HEADERS:-"false"}" == "true" ]]; then | ||
# Upload headers.json.gz | ||
gh release upload "release-$(git rev-parse --short HEAD)" headers.json.gz | ||
fi | ||
|
||
# Upload static library individually. | ||
cp zig-out/lib/libdawn.a "libdawn_$RELEASE_NAME.a" | ||
gzip -9 "libdawn_$RELEASE_NAME.a" | ||
gh release upload "release-$(git rev-parse --short HEAD)" "libdawn_$RELEASE_NAME.a" | ||
|
||
# Upload tarball of static library + headers. | ||
mv out.tar.gz "$RELEASE_NAME.tar.gz" | ||
gh release upload "release-$(git rev-parse --short HEAD)" "$RELEASE_NAME.tar.gz" |