mirror of
https://github.com/p2r3/bareiron.git
synced 2025-10-01 23:25:09 +02:00
62 lines
1.8 KiB
YAML
62 lines
1.8 KiB
YAML
name: Build with Cosmopolitan
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Bun
|
|
uses: oven-sh/setup-bun@v1
|
|
with:
|
|
bun-version: latest
|
|
|
|
- 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: Install JDK 24
|
|
run: |
|
|
curl -LO https://download.java.net/java/GA/jdk24.0.2/fdc5d0102fe0414db21410ad5834341f/12/GPL/openjdk-24.0.2_linux-x64_bin.tar.gz
|
|
tar -xzf openjdk-24.0.2_linux-x64_bin.tar.gz
|
|
|
|
- name: Dump Minecraft server registries
|
|
run: |
|
|
mkdir notchian
|
|
cd notchian
|
|
curl -Lo server.jar https://piston-data.mojang.com/v1/objects/6bce4ef400e4efaa63a13d5e6f6b500be969ef81/server.jar
|
|
echo "eula=true" > eula.txt
|
|
../jdk-24.0.2/bin/java -DbundlerMainClass="net.minecraft.data.Main" -jar server.jar --all
|
|
|
|
- name: Generate registry headers
|
|
run: |
|
|
bun run build_registries.js
|
|
|
|
- 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
|
|
body: "This is a rolling release of bareiron, compiled from the latest commit on the main branch.\n\nThe executable (`bareiron.exe`) is a Cosmopolitan-built polyglot, and should run on Windows and Linux (and Mac?), despite the file extension."
|
|
files: bareiron.exe
|
|
prerelease: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|