Skip to content

Commit

Permalink
test: gha
Browse files Browse the repository at this point in the history
  • Loading branch information
pshirshov committed Oct 23, 2024
1 parent 414e116 commit a634470
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 12 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/baboon-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,11 @@ jobs:
pattern: baboon-*
- name: Prepare layout
run: |
set -e
set -x
tree ./binaries
mkdir dist
mkdir dist-zip
cd ./binaries
find . -name 'baboon-*' -type d -exec bash -e -x -c "zip -r9 ../dist-zip/{}.zip {}/baboon*" \;
find . -name 'baboon-*' -type d -exec bash -e -x -c "mv {} ../dist-zip/" \;
bash prepare-dist.sh ./binaries
- uses: softprops/action-gh-release@v2
id: create-release
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
dist/**
dist-bin/**
dist-zip/**
30 changes: 30 additions & 0 deletions prepare-dist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

set -x
set -e


src=$1

mkdir -p dist-bin
mkdir -p dist-zip

distbin="$(pwd)/dist-bin"
distzip="$(pwd)/dist-zip"

pushd .

cd $src

for d in baboon-*
do
if [[ -f ./$d/baboon ]]; then
cp ./${d}/baboon ${distbin}/${d}
zip -r9 -j ${distzip}/${d}.zip ${distbin}/${d}
elif [[ -f ./$d/baboon.exe ]]; then
cp ./${d}/baboon.exe ${distbin}/${d}.exe
zip -r9 -j ${distzip}/${d}.zip ${distbin}/${d}.exe
else
false
fi
done

0 comments on commit a634470

Please sign in to comment.