-
Notifications
You must be signed in to change notification settings - Fork 1
/
Taskfile.yml
137 lines (114 loc) · 2.85 KB
/
Taskfile.yml
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
version: "3"
# env file:
dotenv:
- .env
env:
LD_LIBRARY_PATH: "$LD_LIBRARY_PATH:$(realpath .magic/envs/default/lib)"
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/
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 build-rs
build:mojo:
aliases: [ "bm" ]
cmds:
- magic run build-mojo
clean:build:
cmds:
- 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 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 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