Release on main branch

This commit is contained in:
David Gonzalez Martin 2024-11-03 13:53:02 -06:00 committed by David
parent eed6fd6de9
commit 93c629c947
2 changed files with 33 additions and 3 deletions

View File

@ -66,3 +66,13 @@ jobs:
env:
CMAKE_BUILD_TYPE: ${{matrix.CMAKE_BUILD_TYPE}}
CMAKE_PREFIX_PATH: ${{steps.FETCH.outputs.CMAKE_PREFIX_PATH}}
BUSTER_GITHUB_RUN: "true"
- name: Release
uses: softprops/action-gh-release@v2
if: github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
${{env.BLOAT_BUSTER_RELEASE_PATH_BASE}}.7z
${{env.BLOAT_BUSTER_RELEASE_PATH_BASE}}.7z.b2sum

View File

@ -1,12 +1,11 @@
#!/usr/bin/env bash
set -eux
original_dir=$PWD
build_dir=build
build_dir=$original_dir/build
C_COMPILER_PATH=clang
CXX_COMPILER_PATH=clang++
ASM_COMPILER_PATH=clang
if [[ -z "${BIRTH_OS-}" ]]; then
case "$OSTYPE" in
msys*)
@ -56,7 +55,9 @@ if [[ -z "${CMAKE_PREFIX_PATH-}" ]]; then
CMAKE_PREFIX_PATH="$HOME/Downloads/llvm-$BIRTH_ARCH-$BIRTH_OS-$CMAKE_BUILD_TYPE"
fi
if [[ -z "${BUSTER_GITHUB_RUN-}" ]]; then
BUSTER_GITHUB_RUN=false
fi
case $BIRTH_OS in
windows)
@ -100,3 +101,22 @@ cd $original_dir
if [ "$#" -ne 0 ]; then
$build_dir/runner $@
fi
if [ "$BUSTER_GITHUB_RUN" == "true" ]; then
case "$BIRTH_OS" in
windows)
OPT_EXTENSION=".exe";;
*)
OPT_EXTENSION="";;
esac
BB_EXE_PATH="$build_dir/bb$OPT_EXTENSION"
BB_INSTALL_NAME=bloat-buster-$BIRTH_ARCH-$BIRTH_OS-$CMAKE_BUILD_TYPE
BB_INSTALL_PATH="$PWD/$BB_INSTALL_NAME"
mkdir -p $BB_INSTALL_PATH
cp $BB_EXE_PATH $BB_INSTALL_PATH
7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=64m -ms=on $BB_INSTALL_NAME.7z $BB_INSTALL_PATH
b2sum $BB_INSTALL_NAME.7z > "$BB_INSTALL_NAME.7z.b2sum"
echo "BLOAT_BUSTER_RELEASE_PATH_BASE=$BB_INSTALL_PATH" >> $GITHUB_ENV
fi