Skip to content

Commit

Permalink
Tweak release script
Browse files Browse the repository at this point in the history
  • Loading branch information
ileitch committed Aug 23, 2024
1 parent 6fd4cde commit f2f41a2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
13 changes: 4 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
BUILD_PATH=.build
SWIFT_BUILD_FLAGS=--product periphery --configuration release --disable-sandbox --scratch-path ${BUILD_PATH}

SWIFT_BUILD_FLAGS=--product periphery --configuration release --disable-sandbox --scratch-path .build
EXECUTABLE_X86_64=$(shell swift build ${SWIFT_BUILD_FLAGS} --arch x86_64 --show-bin-path)/periphery
EXECUTABLE_ARM64=$(shell swift build ${SWIFT_BUILD_FLAGS} --arch arm64 --show-bin-path)/periphery
EXECUTABLE=${BUILD_PATH}/periphery

clean:
@swift package clean
Expand All @@ -15,11 +12,9 @@ build_arm64:
@swift build ${SWIFT_BUILD_FLAGS} --arch arm64

build_release: clean build_x86_64 build_arm64
@lipo -create -output ${EXECUTABLE} ${EXECUTABLE_X86_64} ${EXECUTABLE_ARM64}
@strip -rSTX ${EXECUTABLE}

show_bin_path:
@echo ${EXECUTABLE}
@mkdir -p .release
@lipo -create -output .release/periphery ${EXECUTABLE_X86_64} ${EXECUTABLE_ARM64}
@strip -rSTX .release/periphery

swiftformat:
@./scripts/lint/swiftformat.sh
Expand Down
9 changes: 6 additions & 3 deletions scripts/release
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ cat scripts/artifactbundle_info.json.template | sed s/__VERSION__/${version}/ >
echo -e "\nUpdate CHANGELOG.md"
confirm "Continue?"

bin_path=$(make show_bin_path)
rm -rf "$bin_path"
make build_release
cp "$bin_path" .release/

if [ ! -f .release/periphery ]; then
echo "ERROR: Missing release binary?"
exit 1
fi

cp LICENSE.md .release/
cp scripts/release_notes.md.template .release/release_notes.md

Expand Down

0 comments on commit f2f41a2

Please sign in to comment.