-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRuntfile
69 lines (46 loc) · 1.42 KB
/
Runtfile
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
# runt
Dogfooding runt
## Test
Some test commands using various languages
### javascript
This is a javascript test!
```javascript
process.argv.shift(); // node
process.argv.shift(); // -
console.log('hello', process.argv.shift());
```
### python
this is a python test command to verify args
```python
import sys
print("Hello", sys.argv[1])
```
### bash
```bash
echo "Hello $1"
```
## Release
This command is used to build binaries and generate a release for Homebrew.
Currently supports intel and silicon.
```bash
name="runt"
version="$(cargo read-manifest | jq '.version' -r)"
mac_intel="x86_64-apple-darwin"
mac_silicon="aarch64-apple-darwin"
mac_intel_tar="$name-v$version-$mac_intel.tar.gz"
mac_silicon_tar="$name-v$version-$mac_silicon.tar.gz"
cargo build --target=$mac_intel --release
cargo build --target=$mac_silicon --release
cd target/$mac_silicon/release
tar -czvf "$mac_silicon_tar" $name
silicon_sha=$(shasum -a 256 "$mac_silicon_tar" | cut -d ' ' -f 1)
mv "$mac_silicon_tar" ../../../"$mac_silicon_tar"
cd ../../$mac_intel/release
tar -czvf "$mac_intel_tar" $name
intel_sha=$(shasum -a 256 "$mac_intel_tar" | cut -d ' ' -f 1)
mv "$mac_intel_tar" ../../../"$mac_intel_tar"
cd ../../../
sed -i '' -e "s|X86_64_SHA\ \=.*|X86_64_SHA = '$intel_sha'|" Formula/runt.rb
sed -i '' -e "s|AARCH64_SHA\ \=.*|AARCH64_SHA = '$silicon_sha'|" Formula/runt.rb
sed -i '' -e "s|VERSION\ \=.*|VERSION = '$version'|" Formula/runt.rb
```