From db6b02b5c75be4875dcc70d4347c175f08ede4ca Mon Sep 17 00:00:00 2001 From: Andrew Simard <41052272+500Foods@users.noreply.github.com> Date: Fri, 17 May 2024 18:53:42 -0700 Subject: [PATCH] Create Build-Linux-x86.yml --- .github/workflows/Build-Linux-x86.yml | 58 +++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/Build-Linux-x86.yml diff --git a/.github/workflows/Build-Linux-x86.yml b/.github/workflows/Build-Linux-x86.yml new file mode 100644 index 0000000..cf36cf2 --- /dev/null +++ b/.github/workflows/Build-Linux-x86.yml @@ -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 +