set up cosmopolitan build workflow

This commit is contained in:
p2r3
2025-09-09 13:23:52 +03:00
parent d90a46c832
commit e49904066e
3 changed files with 40 additions and 0 deletions

36
.github/workflows/build.yml vendored Normal file
View File

@@ -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 }}

View File

@@ -18,6 +18,9 @@
#include "lwip/sockets.h"
#include "lwip/netdb.h"
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <time.h>

View File

@@ -7,6 +7,7 @@
#include "lwip/netdb.h"
#include "esp_timer.h"
#else
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <time.h>