Skip to content

Commit

Permalink
Move module build to GitHub actions, add binary building
Browse files Browse the repository at this point in the history
  • Loading branch information
jorikfon committed Nov 23, 2024
1 parent cf5af2d commit dd4f76a
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,63 @@ jobs:
else
echo "Using cached Docker image"
fi
# Build td-keyboard
echo "Building td-keyboard..."
(
cd $GITHUB_WORKSPACE/module/td-keyboard
# Create builder container
builder=$(docker run -t -v "$(pwd)":/src -w /src -d $DOCKER_IMAGE_TAG)
# Build process
docker exec "$builder" go mod tidy
docker exec "$builder" go build -o td-keyboard --ldflags '-extldflags "-static -L/usr/local/lib"'
# Cleanup container
docker stop $builder
docker rm $builder
# Move artifacts
if [ -f $GITHUB_WORKSPACE/module/td-keyboard/td-keyboard ]; then
mv $GITHUB_WORKSPACE/module/td-keyboard/td-keyboard $GITHUB_WORKSPACE/module/bin/td-keyboard
else
echo 'Error build td-keyboard'
exit 1
fi
)
rm -rf $GITHUB_WORKSPACE/module/td-keyboard
# Build tg2sip
echo "Building tg2sip..."
(
cd $GITHUB_WORKSPACE/module/tg2sip
# Create builder container
builder=$(docker run -t -v "$(pwd)":/src -w /src -d $DOCKER_IMAGE_TAG)
# Build process
docker exec "$builder" cmake -DCMAKE_BUILD_TYPE=Release .
docker exec "$builder" cmake --build .
# Cleanup container
docker stop $builder
docker rm $builder
# Move artifacts
if [ -f $GITHUB_WORKSPACE/module/tg2sip/gen_db ]; then
mv $GITHUB_WORKSPACE/module/tg2sip/gen_db $GITHUB_WORKSPACE/module/bin/gen_db
else
echo 'Error build gen_db'
exit 1
fi
ls -la
if [ -f $GITHUB_WORKSPACE/module/tg2sip/tg ]; then
mv $GITHUB_WORKSPACE/module/tg2sip/tg $GITHUB_WORKSPACE/module/bin/tg2sip
else
echo 'Error build tg2sip'
exit 1
fi
)
rm -rf $GITHUB_WORKSPACE/module/tg2sip
secrets: inherit

0 comments on commit dd4f76a

Please sign in to comment.