aboutsummaryrefslogtreecommitdiffhomepage
path: root/.github
diff options
context:
space:
mode:
authorGautham <ahgamut@gmail.com>2024-04-20 22:09:10 -0500
committerGautham <ahgamut@gmail.com>2024-04-20 22:09:10 -0500
commitbf680fb5d32183f8233227bdbf28363597539f49 (patch)
treef2343936accf694cdfd20880bd7957de4e524038 /.github
parentsimplify naming (diff)
simplify janet APE build
Diffstat (limited to '.github')
-rw-r--r--.github/cosmo/build11
-rw-r--r--.github/cosmo/recipe.mk26
-rw-r--r--.github/cosmo/setup28
-rw-r--r--.github/workflows/release.yml22
4 files changed, 70 insertions, 17 deletions
diff --git a/.github/cosmo/build b/.github/cosmo/build
new file mode 100644
index 00000000..22c51c46
--- /dev/null
+++ b/.github/cosmo/build
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# copy janet recipe
+mkdir -p /sc/sueprconfigure/janet
+cp ./.github/cosmo/recipe.mk /sc/superconfigure/BUILD.mk
+cat 'include janet/BUILD.mk' >> /sc/superconfigure/custom.mk
+
+export SOURCE_DIR=$(realpath .)
+
+cd /sc/superconfigure
+make o/janet/built.fat
diff --git a/.github/cosmo/recipe.mk b/.github/cosmo/recipe.mk
new file mode 100644
index 00000000..a49adaf4
--- /dev/null
+++ b/.github/cosmo/recipe.mk
@@ -0,0 +1,26 @@
+# this recipe is copied into superconfigure/janet/BUILD.mk
+o/janet/downloaded: \
+ DL_COMMAND = cp -r $(SOURCE_DIR) ./ && ls -al && ls -al ..
+
+o/janet/patched: PATCH_COMMAND = $(DUMMYLINK0)
+
+o/janet/configured.x86_64: \
+ CONFIG_COMMAND = cp -r $(BASELOC)/o/janet/janet/* ./
+
+o/janet/configured.aarch64: \
+ CONFIG_COMMAND = cp -r $(BASELOC)/o/janet/janet/* ./
+
+o/janet/built.x86_64: \
+ BUILD_COMMAND = make PREFIX=$(COSMOS) HAS_SHARED=0 JANET_NO_AMALG=1
+
+o/janet/built.aarch64: \
+ BUILD_COMMAND = make PREFIX=$(COSMOS) HAS_SHARED=0 JANET_NO_AMALG=1
+
+o/janet/installed.x86_64: \
+ INSTALL_COMMAND = cp build/janet $(COSMOS)/bin/
+
+o/janet/installed.aarch64: \
+ INSTALL_COMMAND = cp build/janet $(COSMOS)/bin/
+
+o/janet/built.fat: \
+ BINS = janet
diff --git a/.github/cosmo/setup b/.github/cosmo/setup
new file mode 100644
index 00000000..ca7d0424
--- /dev/null
+++ b/.github/cosmo/setup
@@ -0,0 +1,28 @@
+#!/bin/sh
+set -e
+
+sudo apt update
+sudo apt-get install -y ca-certificates libssl-dev\
+ qemu qemu-utils qemu-user-static\
+ texinfo groff\
+ cmake ninja-build bison zip\
+ pkg-config build-essential autoconf re2c
+
+# clone superconfigure
+cd /sc
+git clone https://github.com/ahgamut/superconfigure --depth=1 --branch=z0.0.39
+
+# the zip folder
+sudo mkdir -p /zip
+sudo chmod -R 0777 /zip
+
+# clone cosmo
+cd /sc/superconfigure
+git clone https://github.com/jart/cosmopolitan --depth=1 --branch=3.3.3 cosmopolitan
+sudo cp cosmopolitan/build/bootstrap/ape.elf /usr/bin/ape
+sudo sh -c "echo ':APE:M::MZqFpD::/usr/bin/ape:' >/proc/sys/fs/binfmt_misc/register"
+# ls /proc/sys/fs/binfmt_misc/
+
+# build cosmo
+cd /sc/superconfigure
+./.github/scripts/cosmo
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index b4b0f061..6d9d9ea2 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -67,32 +67,20 @@ jobs:
name: Build release binaries for Cosmo
runs-on: ubuntu-latest
steps:
+ - name: Checkout the repository
+ uses: actions/checkout@master
- name: create build folder
run: |
sudo mkdir -p /sc
sudo chmod -R 0777 /sc
- - name: Checkout superconfigure repo
- working-directory: /sc
- run: git clone https://github.com/ahgamut/superconfigure
- - name: support ape bins and SSL things
- working-directory: /sc/superconfigure
- run: bash ./.github/scripts/setup
- - name: build Cosmo
- working-directory: /sc/superconfigure
- run: bash ./.github/scripts/cosmo
- - name: clone Janet latest commit
- working-directory: /sc/superconfigure
- run: |
- make o/lang/janet/downloaded
- cd o/lang/janet/janet
- git pull origin master
+ - name: setup Cosmopolitan Libc
+ run: bash ./.github/cosmo/setup
- name: Set the version
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: Set the platform
run: echo "platform=cosmo" >> $GITHUB_ENV
- name: build Janet APE binary
- working-directory: /sc/superconfigure
- run: make o/lang/janet/built.fat
+ run: bash ./.github/cosmo/build
- name: push binary to github
uses: softprops/action-gh-release@v1
with: