-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathTaskfile.yml
More file actions
165 lines (143 loc) · 3.8 KB
/
Taskfile.yml
File metadata and controls
165 lines (143 loc) · 3.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
version: "3"
# env file:
dotenv:
- .env
# global env:
env:
ENV1: testing
# LD_LIBRARY_PATH: "{{.PWD}}/.magic/envs/default/lib:{{.PWD}}/bin" # TODO X: for linux
# DYLD_LIBRARY_PATH: "{{.PWD}}/.magic/envs/default/lib:{{.PWD}}/bin" # TODO X: for macos
# DYLD_LIBRARY_PATH: "{{.PWD}}/.magic/envs/default/lib" # TODO X: for macos
tasks:
install:ubuntu:
cmds:
- apt install -y zip # unzip libsonic-0.1.1-hb0f4dca_0.conda
- apt install -y zstd # tar -I zstd -xvf pkg-libsonic-0.1.1-hb0f4dca_0.tar.zst
init:
cmds:
- magic project platform add osx-arm64
pkg:
cmds:
# - pixi {{.CLI_ARGS}}
- magic {{.CLI_ARGS}}
run:
cmds:
- echo $(realpath .magic/envs/default/lib)
- echo $LD_LIBRARY_PATH
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(realpath .magic/envs/default/lib); magic run mojo run src/main.mojo
dir: examples/try-sonic/
build:run:
aliases: ["brun"]
cmds:
- echo "DYLD_LIBRARY_PATH = $DYLD_LIBRARY_PATH"
- mkdir -p output/
- magic run mojo build src/main.mojo -o ./output/main
- ./output/main
ignore_error: true
generate:
aliases: ["gen"]
cmds:
- RUST_LOG=info cargo run --bin gen
rel:
cmds:
- cargo build --release
dir: sonic_rs_bindings/
rel:mojo:
aliases: ["relm"]
cmds:
- mkdir build/
- magic run mojo package sonic -o ./build/sonic_mojo.mojopkg
ignore_error: true
build:rust:
aliases: ["br"]
cmds:
- magic run -e=dev build-rs
build:mojo:
aliases: ["bm"]
cmds:
- magic i -e=dev
- magic run -e=dev build-mojo
- open output/
clean:build:
aliases: ["cb"]
cmds:
- rm -rf build/
- task: br
- task: bm
#
# ref: https://taskfile.dev/usage/#looping-over-variables
#
publish:ffi:
aliases: ["upf", "pub", "pub:auto"]
vars:
UP_PKGS:
sh: find . -name "*.conda" -type f
cmds:
- echo $PREFIX_DEV_API_KEY
- echo {{ .UP_PKGS }}
- for: { var: UP_PKGS }
cmd: |
magic run -e=dev rattler-build upload prefix -c "better-ffi" \
--api-key=$PREFIX_DEV_API_KEY \
{{.ITEM}}
- open https://prefix.dev/channels/better-ffi
dir: output/
publish:mojo:
aliases: ["upm"]
vars:
UP_PKGS:
sh: find . -name "*.conda" -type f
cmds:
- echo $PREFIX_DEV_API_KEY
- echo {{ .UP_PKGS }}
- for: { var: UP_PKGS }
cmd: |
magic run -e=dev rattler-build upload prefix -c "better-mojo" \
--api-key=$PREFIX_DEV_API_KEY \
{{.ITEM}}
- open https://prefix.dev/channels/better-mojo
dir: output/
publish:mojo:nightly:
aliases: ["upmn", "up:m:n"]
vars:
UP_PKGS:
sh: find . -name "*.conda" -type f
cmds:
- echo $PREFIX_DEV_API_KEY
- echo {{ .UP_PKGS }}
- for: { var: UP_PKGS }
cmd: |
magic run -e=dev rattler-build upload prefix -c "better-mojo-nightly" \
--api-key=$PREFIX_DEV_API_KEY \
{{.ITEM}}
- open https://prefix.dev/channels/better-mojo-nightly
dir: output/
clean:
aliases: ["cl", "del"]
cmds:
- rm -rf output/
# - cargo clean
###########################################################################
quick:
aliases: ["q"]
cmds:
- task: commit
- task: commit
- git status
- task: push
ignore_error: true
commit:
aliases: ["c"]
cmds:
- git add .
- git commit -m "update" --no-verify
ignore_error: true
pull:
aliases: ["pl"]
cmds:
- git pull
push:
aliases: ["p"]
cmds:
- git push origin main --tags
- repo_url=`git remote -v | grep push | awk -F ":" '{print $2}' | awk -F ".git" '{print "https://github.com/"$1}'`; open $repo_url