Skip to content

Commit

Permalink
Create Build-Linux-x86.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
500Foods authored May 18, 2024
1 parent 955dd47 commit db6b02b
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/Build-Linux-x86.yml
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

0 comments on commit db6b02b

Please sign in to comment.