Compare commits

...

46 Commits

7 changed files with 114 additions and 7 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ on:
push:
branches:
- main
pull_request:
# pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
+81
View File
@@ -0,0 +1,81 @@
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-appimage:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: XTL_CONFIG=debug make linux-dist
- name: Upload AppImage
uses: actions/upload-artifact@v4
with:
name: xtool-linux-aarch64
path: Linux/packages/xtool-aarch64.AppImage
compression-level: 0
build-mac:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Build
run: |
brew install xcodegen
make mac DEVELOPMENT_TEAM='""'
(cd macOS/Build/XcodeInstall && zip -yqr xtool.app.zip xtool.app)
- name: Upload app
uses: actions/upload-artifact@v4
with:
name: xtool-mac
path: macOS/Build/XcodeInstall/xtool.app.zip
compression-level: 0
test:
needs: [build-appimage, build-mac]
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: xtool-*
merge-multiple: true
path: stage
- name: Process artifacts
run: |
chmod +x stage/xtool-aarch64.AppImage
unzip -q stage/xtool.app.zip -d stage
ln -fs "$PWD/stage/xtool.app/Contents/Resources/bin/xtool" /usr/local/bin/xtool
# https://github.com/abiosoft/colima/issues/970#issuecomment-2224011277
- name: Setup Docker
run: |
brew install --formula docker colima qemu
LIMACTL_PATH=$(brew --prefix)/bin/limactl
sudo curl -fL -o $LIMACTL_PATH https://github.com/mikekazakov/lima-nohvf/raw/acd34e689a7186d8317116165101b1fa56083542/limactl
sudo chmod +x $LIMACTL_PATH
colima start --disk 20 --vm-type qemu --arch arm64
- name: Build SDK
run: |
xtool sdk build /Applications/Xcode_16.3.app stage
- name: Run test
run: |
docker run --rm -i \
-v ./stage:/stage \
swift:6.1.1 \
bash << EOF
mkdir -p ~/.swiftpm/swift-sdks
ln -fs /stage/darwin.artifactbundle ~/.swiftpm/swift-sdks/
export APPIMAGE_EXTRACT_AND_RUN=1
ln -fs /stage/xtool-aarch64.AppImage /usr/local/bin/xtool
xtool new Hello --skip-setup
cd Hello
xtool dev build
EOF
+4 -2
View File
@@ -13,8 +13,10 @@ fi
rm -rf staging/tmp
mkdir -p staging/tmp staging/linuxdeploy
swift build --package-path .. -c release --product xtool --static-swift-stdlib
bin="$(swift build --package-path .. -c release --show-bin-path)"
RESOLVED_CONFIG="${XTL_CONFIG:-release}"
swift build --package-path .. -c "${RESOLVED_CONFIG}" --product xtool --static-swift-stdlib
bin="$(swift build --package-path .. -c "${RESOLVED_CONFIG}" --show-bin-path)"
strip "${bin}/xtool"
curr_git_info="$(curl -fsSL https://api.github.com/repos/linuxdeploy/linuxdeploy/git/refs/tags/continuous)"
+1 -1
View File
@@ -54,7 +54,7 @@ linux-clean:
.PHONY: linux-dist
# dist build for Linux
linux-dist:
docker compose run --build --rm xtool Linux/build.sh
docker compose run --build -e XTL_CONFIG --rm xtool Linux/build.sh
.PHONY: mac
# dev build for macOS
+17 -1
View File
@@ -1,5 +1,4 @@
GENERATE_INFOPLIST_FILE = YES
CODE_SIGN_ENTITLEMENTS = Support/XToolMac.entitlements
CODE_SIGN_STYLE = Automatic
ENABLE_HARDENED_RUNTIME = YES
@@ -10,3 +9,20 @@ INFOPLIST_KEY_LSApplicationCategoryType = public.app-category.developer-tools
#include? "Private-Team.xcconfig"
#include? "Private.xcconfig"
XTL_IS_EMPTY_ = YES
XTL_COERCE_TO_BOOL_YES = YES
XTL_COERCE_TO_BOOL_ = NO
XTL_INVERT_YES = NO
XTL_INVERT_NO = YES
XTL_HAS_TEAM = $(XTL_INVERT_$(XTL_COERCE_TO_BOOL_$(XTL_IS_EMPTY_$(DEVELOPMENT_TEAM))))
XTL_CODE_SIGN_ENTITLEMENTS_NO = Support/XToolMac-NoTeam.entitlements
XTL_CODE_SIGN_ENTITLEMENTS_YES = Support/XToolMac.entitlements
CODE_SIGN_ENTITLEMENTS = $(XTL_CODE_SIGN_ENTITLEMENTS_$(XTL_HAS_TEAM))
ENABLE_HARDENED_RUNTIME = $(XTL_HAS_TEAM)
XTL_TEAM_DEFINE_YES = -DHAS_TEAM
OTHER_SWIFT_FLAGS = $(inherited) $(XTL_TEAM_DEFINE_$(XTL_HAS_TEAM))
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>
+4 -2
View File
@@ -15,8 +15,10 @@ import XKit
}
private static func runXTool() async throws {
try await withDependencies {
$0.keyValueStorage = KeychainStorage(service: "sh.xtool.keychain.credentials")
try await withDependencies { d in
#if HAS_TEAM
d.keyValueStorage = KeychainStorage(service: "sh.xtool.keychain.credentials")
#endif
} operation: {
try await XTool.run()
}