diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..a20868a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,36 @@ +name: Build with Cosmopolitan + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Download cosmocc + run: | + curl -LO https://cosmo.zip/pub/cosmocc/cosmocc.zip + unzip cosmocc.zip -d cosmocc + echo "$PWD/cosmocc/bin" >> $GITHUB_PATH + + - name: Build project + run: | + cosmocc src/*.c -O3 -Iinclude -o bareiron.exe + + - name: Upload release + uses: softprops/action-gh-release@v2 + with: + tag_name: latest + name: Latest build + files: bareiron.exe + overwrite: true + prerelease: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/src/main.c b/src/main.c index c40d3d6..331f960 100644 --- a/src/main.c +++ b/src/main.c @@ -18,6 +18,9 @@ #include "lwip/sockets.h" #include "lwip/netdb.h" #else + #include + #include + #include #include #include #include diff --git a/src/tools.c b/src/tools.c index 3fc84b6..f23ba45 100644 --- a/src/tools.c +++ b/src/tools.c @@ -7,6 +7,7 @@ #include "lwip/netdb.h" #include "esp_timer.h" #else + #include #include #include #include