build libobjc #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
workflow_dispatch: | |
create: | |
release: | |
types: [created] | |
name: build libobjc | |
jobs: | |
build: | |
name: build libobjc | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get cosmos-sdk | |
run: | | |
cd | |
mkdir -p .cosmo | |
cd .cosmo | |
wget https://cosmo.zip/pub/cosmocc/cosmocc-3.1.3.zip | |
wget https://github.com/codehz/superconfigure/releases/download/main/aarch64-gcc.zip | |
wget https://github.com/codehz/superconfigure/releases/download/main/x86_64-gcc.zip | |
unzip cosmocc-3.1.3.zip | |
unzip -o aarch64-gcc.zip | |
unzip -o x86_64-gcc.zip | |
rm *.zip | |
- name: Fix ape | |
run: | | |
curl https://justine.lol/ape.elf >ape | |
chmod +x ape | |
sudo mv ape /usr/bin/ape | |
sudo sh -c "echo ':APE:M::MZqFpD::/usr/bin/ape:' >/proc/sys/fs/binfmt_misc/register" | |
- name: Run make | |
run: make && tree | |
- name: Export as artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: libobjc | |
path: | | |
libobjc.a | |
.aarch64/libobjc.a | |
src/objc/*.h | |
- name: Create zip for release | |
run: | | |
mkdir include | |
cp -r src/objc include | |
mkdir -p aarch64-linux-cosmo/lib/ | |
cp .aarch64/libobjc.a aarch64-linux-cosmo/lib/libobjc.a | |
mkdir -p x86_64-linux-cosmo/lib/ | |
cp libobjc.a x86_64-linux-cosmo/lib/libobjc.a | |
zip -r libobjc.zip aarch64-linux-cosmo/lib/libobjc.a x86_64-linux-cosmo/lib/libobjc.a include/objc/*.h | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file_glob: true | |
file: "libobjc.zip" | |
overwrite: true |