Skip to content

Commit 9257460

Browse files
SersemPecaalehander92
authored andcommitted
feat(ci): Define mac builder; Fix some mac scripts
1 parent afdbcb6 commit 9257460

File tree

7 files changed

+21
-6
lines changed

7 files changed

+21
-6
lines changed

.github/workflows/codetracer.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ jobs:
211211
AWS_ACCESS_KEY_ID: ${{ secrets.R2_CODETRACER_BUCKET_ACCESS_KEY_ID }}
212212
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_CODETRACER_BUCKET_ACCESS_KEY }}
213213
run: |
214-
aws --endpoint-url=${{ secrets.R2_CODETRACER_BUCKET_S3_ENDPOINT }} s3 cp CodeTracer.dmg s3://${{ vars.R2_CODETRACER_BUCKET_NAME }}/CodeTracer-${{ github.ref_name }}-arm64.dmg
214+
aws --endpoint-url=${{ secrets.R2_CODETRACER_BUCKET_S3_ENDPOINT }} s3 cp ./non-nix-build/CodeTracer.dmg s3://${{ vars.R2_CODETRACER_BUCKET_NAME }}/CodeTracer-${{ github.ref_name }}-arm64.dmg
215215
216216
217217
test-rust:
@@ -220,6 +220,7 @@ jobs:
220220
- dev-build
221221
- nix-build
222222
- appimage-build
223+
- dmg-build
223224
steps:
224225
- name: Checkout
225226
uses: actions/checkout@v4

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ nimcache/
77
.venv/
88
build-*/
99

10+
# Mac build
11+
*.app
12+
*.dmg
13+
1014
# Direnv or shell hook + Nix Flake generated files
1115
.direnv/
1216
result

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@
7070
url = https://github.com/cheatfate/nimcrypto.git
7171
[submodule "libs/zip"]
7272
path = libs/zip
73-
url = git@github.com:nim-lang/zip.git
73+
url = https://github.com/nim-lang/zip.git

non-nix-build/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ cd $NON_NIX_BUILD_DIR
77

88
source env.sh
99

10+
1011
echo "platform: ${platform}; os: ${os}"
1112

12-
mkdir -p "$BIN_DIR" "$DEPS_DIR"
1313

1414
# passing platform and os as args, not env var, to make it easier
1515
# to pass in nix-shell without modifying env
@@ -24,7 +24,7 @@ case $platform in
2424
./build_mac_app.sh
2525
./install_libraries.sh
2626
echo Successfully built non-nix-build/CodeTracer.app
27-
./buid_dmg.sh
27+
./build_dmg.sh
2828
echo Successfully built non-nix-build/CodeTracer.dmg
2929
;;
3030
*)

non-nix-build/build_dmg.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#!/usr/bin/env bash
22

3+
brew install create-dmg
4+
35
create-dmg \
46
--volname "CodeTracer" \
57
--background "dmg_background.png" \
68
--window-pos 200 120 \
79
--window-size 600 400 \
810
--icon-size 100 \
911
--icon "CodeTracer.app" 150 190 \
10-
--hide-extensions "CodeTracer.app" \
1112
--app-drop-link 450 185 \
1213
"CodeTracer.dmg" \
1314
"CodeTracer.app"

non-nix-build/env.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ export os
3232
: ${BIN_DIR:=$NON_NIX_BUILD_DIR/bin}
3333
: ${DEPS_DIR:=$NON_NIX_BUILD_DIR/deps}
3434

35+
echo "BIN_DIR" "${BIN_DIR}"
36+
echo "DEPS_DIR" "${DEPS_DIR}"
37+
38+
mkdir -p "$BIN_DIR"
39+
mkdir -p "$DEPS_DIR"
40+
3541
export BIN_DIR
3642
export DEPS_DIR
3743
export DIST_DIR

non-nix-build/install_libraries.sh

100644100755
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env bash
22

3-
LIB_DIR="./CodeTracer.app/Contents/Frameworks"
3+
GIT_ROOT=$(git rev-parse --show-toplevel)
4+
5+
LIB_DIR="${GIT_ROOT}/CodeTracer.app/Contents/Frameworks"
46

57
mkdir -p "${LIB_DIR}"
68

@@ -12,3 +14,4 @@ cp "${HOMEBREW_LIB_DIR}/libzip.dylib" "${LIB_DIR}"
1214

1315
install_name_tool -add_rpath "${LIB_DIR}" "${DIST_DIR}"/bin/ct
1416
install_name_tool -change /usr/lib/libzip.dylib @rpath/libzip.dylib "${DIST_DIR}"/bin/ct
17+

0 commit comments

Comments
 (0)