Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update workflow, script, and submodules #7

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 32 additions & 39 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,13 @@ on:
- push
- workflow_dispatch

jobs:
create_release:
# https://github.com/actions/create-release/issues/14#issuecomment-555379810
runs-on: ubuntu-24.04
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Draft Release
body: ''
draft: true
- name: Save Upload URL to File
run: printf "%s" "${{ steps.create_release.outputs.upload_url }}" > upload_url.txt
- name: Save Upload URL as Artifact
uses: actions/upload-artifact@v4
with:
name: upload_url
path: upload_url.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
build:
needs: create_release
strategy:
fail-fast: false
matrix:
include:
- name: ubuntu20.04
Expand All @@ -40,28 +21,40 @@ jobs:
image: ubuntu:24.04
- name: fedora39
image: fedora:39
runs-on: ubuntu-24.04
- name: archlinux
image: archlinux:base-devel

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Fetch Upload URL
uses: actions/download-artifact@v4
with:
name: upload_url
- name: Build Release
id: build_release
run: |
DARWIN_BUILD_BASE=${{ matrix.image }} docker compose run --build --rm builder -c ./prepare-toolchain
echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
echo "::set-output name=upload_url::$(cat upload_url.txt)"
rm upload_url.txt
- name: Upload Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifact
id: upload_artifact
uses: actions/upload-artifact@v4
with:
upload_url: ${{ steps.build_release.outputs.upload_url }}
asset_path: packages/darwin-tools.tar.gz
asset_name: darwin-tools-${{ matrix.name }}.tar.gz
asset_content_type: application/gzip
name: DT-${{ matrix.name }}
path: packages/darwin-tools.tar.gz

release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download artifact
id: download_artifact
uses: actions/download-artifact@v4
with:
pattern: DT-*
path: packages

- name: Create and publish release
id: publish_release
run: |
TAG="${GITHUB_REF##*/}-${GITHUB_SHA:0:7}"
gh release create "$TAG" --draft --title "Draft Release"
gh release upload "$TAG" packages/**/*.tar.gz
7 changes: 5 additions & 2 deletions install-deps
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

Expand All @@ -22,8 +22,11 @@ if [[ "$distro" = "ubuntu:"* ]]; then
elif [[ "$distro" = "fedora:"* ]]; then
yum -y install binutils git-all clang libcxx-devel libcxxabi-devel libcxxabi-static cmake make automake which libtool openssl-devel
entry_env="export CC=clang CXX=clang++"
elif [[ "$distro" = "archlinux:"* ]]; then
pacman -Sy --needed --noconfirm base-devel cmake clang libc++ git python openssl perl
entry_env="export CC=clang CXX=clang++"
else
echo "install-deps: I don't know how to install dependencies for $distro"
echo "$0: I don't know how to install dependencies for $distro"
exit 1
fi

Expand Down
26 changes: 12 additions & 14 deletions prepare-toolchain
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,22 @@ mkdir -p "${INSTALLPREFIX}"
rm -rf "${INSTALLPREFIX}"

info "Building LLVM tools"
mkdir -p "${STAGING}/build/apple-libtapi"
cd "${STAGING}/build/apple-libtapi"
cmake "${VENDOR}/apple-libtapi/src/llvm" \
-DCMAKE_CXX_FLAGS="-I${PWD}/../src/llvm/projects/clang/include -I${PWD}/projects/clang/include" \
mkdir -p "${STAGING}/build/"
cd "${STAGING}/build/"
cmake -B libtapi -S "${VENDOR}/apple-libtapi/src/llvm" \
-DLLVM_ENABLE_PROJECTS="tapi;clang" \
-DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64" \
-DLLVM_INCLUDE_TESTS=OFF \
-DCMAKE_CXX_FLAGS="-I${PWD}/../src/llvm/projects/clang/include -I${PWD}/projects/clang/include" \
-DCMAKE_BUILD_TYPE=RELEASE \
-DLLVM_ENABLE_PROJECTS="tapi;clang" \
-DCMAKE_INSTALL_PREFIX="${INSTALLPREFIX}"
make clangBasic -j "${JOBS}"
make libtapi dsymutil install-libtapi install-tapi-headers install-dsymutil -j "${JOBS}"
cmake --build libtapi --target install-libtapi install-tapi-headers install-tapi install-dsymutil -- -j "${JOBS}"

info "Building libdispatch"
mkdir -p "${STAGING}/build/apple-libdispatch"
cd "${STAGING}/build/apple-libdispatch"
cmake "${VENDOR}/apple-libdispatch" \
cmake -B libdispatch -S "${VENDOR}/apple-libdispatch" \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX="$INSTALLPREFIX"
make -j "${JOBS}" install
cmake --build libdispatch --target install -- -j "${JOBS}"

info "Building cctools"
mkdir -p "${STAGING}/build/cctools"
Expand All @@ -64,8 +62,9 @@ PLIST_PREFIX="${STAGING}/libplist-install"
mkdir -p "${PLIST_PREFIX}" "${STAGING}/build/libplist"
LC_ALL=C NOCONFIGURE=1 ./autogen.sh
cd "${STAGING}/build/libplist"
LC_ALL=C "${VENDOR}/libplist/configure" --prefix="${PLIST_PREFIX}" --without-cython PACKAGE_VERSION=latest
LC_ALL=C "${VENDOR}/libplist/configure" --prefix="${PLIST_PREFIX}" --without-cython --enable-static --disable-shared PACKAGE_VERSION=latest
make -j "${JOBS}" install
cp -av "${PLIST_PREFIX}/bin/plistutil" "${INSTALLPREFIX}/bin"
L1ghtmann marked this conversation as resolved.
Show resolved Hide resolved

info "Building ldid"
cd "${VENDOR}/ldid"
Expand All @@ -77,7 +76,6 @@ make -j "${JOBS}" \

info "Packaging toolchain"
mkdir -p "${PACKAGES}"
cd "${STAGING}/prefix"
tar -czf "${PACKAGES}/darwin-tools.tar.gz" linux
tar -czf "${PACKAGES}/darwin-tools.tar.gz" -C "${STAGING}/prefix" linux

info "Done!"
2 changes: 1 addition & 1 deletion vendor/ldid
Submodule ldid updated 1 files
+22 −18 .github/workflows/build.yml
2 changes: 1 addition & 1 deletion vendor/libplist
Submodule libplist updated 113 files