-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Build Linux x86 | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
jobs: | ||
|
||
build: | ||
name: Build Linux 32-bit | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libsqlite3-dev:i386 libxxhash-dev:i386 libjansson-dev:i386 libwebsockets-dev:i386 fswatch:i386 libcurl4-openssl-dev:i386 libssl-dev:i386 | ||
- name: Find fswatch library | ||
run: | | ||
dpkg -s fswatch:i386 | ||
dpkg -L fswatch:i386 | ||
fswatch_lib=$(dpkg -L fswatch:i386 | grep 'libfswatch\.so' | head -n 1) | ||
fswatch_inc=$(dpkg -L fswatch:i386 | grep 'cevent\.h' | head -n 1 | xargs dirname) | ||
echo "FSWATCH_LIB=-L$(dirname $fswatch_lib)" >> $GITHUB_ENV | ||
echo "FSWATCH_INC=-I$fswatch_inc" >> $GITHUB_ENV | ||
- name: Build agentc | ||
working-directory: ./AgentC | ||
run: gcc -m32 agentc.c -o agentc -lsqlite3 -lxxhash -ljansson -lwebsockets ${{ env.FSWATCH_LIB }} -lfswatch ${{ env.FSWATCH_INC }} -lcurl -lssl -lcrypto | ||
|
||
- name: Copy agentc to dist folder | ||
run: | | ||
mkdir -p ./dist | ||
cp ./AgentC/agentc ./dist/agentc-linux-x86 | ||
- name: Check for changes | ||
id: changes | ||
run: | | ||
if git diff --quiet HEAD; then | ||
echo "has_changes=false" >> $GITHUB_OUTPUT | ||
else | ||
echo "has_changes=true" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Commit and push changes | ||
if: steps.changes.outputs.has_changes == 'true' | ||
run: | | ||
git config --global user.email "github-actions@example.com" | ||
git config --global user.name "GitHub Actions" | ||
git add ./dist/agentc-linux-x86 | ||
git commit -m "Add agentc-linux-x86 to dist folder" | ||
git push "https://${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}.git" HEAD:main | ||