Skip to content

Commit

Permalink
workflows : add release script for Android x86_64. no CO-RE default.
Browse files Browse the repository at this point in the history
Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
  • Loading branch information
cfc4n committed Nov 5, 2022
1 parent d2b4b26 commit 7dea083
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/go-c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,14 @@ jobs:
uname -a
apt-get update
apt-get install --yes wget git golang build-essential pkgconf libelf-dev llvm-9 clang-9 linux-tools-generic linux-tools-common
wget https://golang.google.cn/dl/go1.18.8.linux-arm64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.18.8.linux-arm64.tar.gz
# Produce a binary artifact and place it in the mounted volume
run: |
uname -a
date
export PATH=$PATH:/usr/local/bin
export PATH=/usr/local/go/bin:$PATH:/usr/local/bin
echo $PATH
for tool in "clang" "llc" "llvm-strip"
do
rm -f /usr/bin/$tool
Expand All @@ -199,7 +202,7 @@ jobs:
echo "-------------------start: Create ecapture.tar.gz of Linux -------------------"
make env
make clean
make
make nocore
echo "-------------------ecapture --help-------------------"
bin/ecapture -v
echo "-------------------create tar.gz file-------------------"
Expand All @@ -226,7 +229,7 @@ jobs:
echo "-------------------start: Create ecapture.tar.gz of Android kernel CO:RE -------------------"
make env
make clean
ANDROID=1 make
ANDROID=1 make nocore
echo "-------------------ecapture --help-------------------"
echo "bin/ecapture -v"
echo "-------------------create tar.gz file-------------------"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ jobs:
uname -a
date
export PATH=/usr/local/go/bin:$PATH:/usr/local/bin
echo $PATH
for tool in "clang" "llc" "llvm-strip"
do
rm -f /usr/bin/$tool
Expand Down
33 changes: 30 additions & 3 deletions builder/Makefile.release
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

.PHONY: all
all: help
release: snapshot publish
release: snapshot snapshot_android publish

#
# make
Expand Down Expand Up @@ -118,6 +118,7 @@ help:

OUTPUT_DIR = ./bin
TAR_DIR = ecapture-$(SNAPSHOT_VERSION)-linux-$(UNAME_M)
TAR_DIR_ANDROID = ecapture-$(SNAPSHOT_VERSION)-android-$(UNAME_M)

# from CLI args.
RELEASE_NOTES ?= $(OUTPUT_DIR)/release_notes.txt
Expand All @@ -143,7 +144,8 @@ snapshot: \
.check_$(CMD_GITHUB)

# build binaries
$(MAKE)
$(MAKE) clean
$(MAKE) nocore
# create the tar ball and checksum files
$(CMD_MKDIR) -p $(TAR_DIR)
$(CMD_CP) LICENSE $(TAR_DIR)/LICENSE
Expand All @@ -157,16 +159,41 @@ snapshot: \
$(CMD_CHECKSUM) $(TAR_DIR).tar.gz > ./../$(OUT_CHECKSUMS)
cd ../

.PHONY: snapshot_android
snapshot_android: \
$(OUTPUT_DIR) \
| .check_tree \
.check_$(CMD_TAR) \
.check_$(CMD_CHECKSUM) \
.check_$(CMD_GITHUB)

# build binaries
$(MAKE) clean
ANDROID=1 $(MAKE) nocore
# create the tar ball and checksum files
$(CMD_MKDIR) -p $(TAR_DIR_ANDROID)
$(CMD_CP) LICENSE $(TAR_DIR_ANDROID)/LICENSE
$(CMD_CP) CHANGELOG.md $(TAR_DIR_ANDROID)/CHANGELOG.md
$(CMD_CP) README.md $(TAR_DIR_ANDROID)/README.md
$(CMD_CP) README_CN.md $(TAR_DIR_ANDROID)/README_CN.md
$(CMD_MV) $(OUTPUT_DIR)/ecapture $(TAR_DIR_ANDROID)/ecapture
$(CMD_MV) $(OUTPUT_DIR)/release_notes.txt $(TAR_DIR_ANDROID)/release_notes.txt
$(CMD_TAR) -czf $(OUT_ARCHIVE) $(TAR_DIR_ANDROID)
cd $(OUTPUT_DIR)
$(CMD_CHECKSUM) $(TAR_DIR_ANDROID).tar.gz >> ./../$(OUT_CHECKSUMS)
cd ../

.PHONY: publish
publish: \
$(OUTPUT_DIR) \
$(OUT_ARCHIVE) \
$(TAR_DIR_ANDROID) \
$(OUT_CHECKSUMS) \
| .check_tree \
.check_$(CMD_GITHUB)
#
# release it!
$(CMD_GITHUB) release create $(SNAPSHOT_VERSION) $(OUT_ARCHIVE) $(OUT_CHECKSUMS) --title "eCapture $(SNAPSHOT_VERSION)" --notes-file $(TAR_DIR)/release_notes.txt
$(CMD_GITHUB) release create $(SNAPSHOT_VERSION) $(OUT_ARCHIVE) $(TAR_DIR_ANDROID) $(OUT_CHECKSUMS) --title "eCapture $(SNAPSHOT_VERSION)" --notes-file $(TAR_DIR)/release_notes.txt

.PHONY: clean
clean:
Expand Down

0 comments on commit 7dea083

Please sign in to comment.