-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathJustfile
executable file
·133 lines (105 loc) · 4.3 KB
/
Justfile
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
all: build test
build:
cargo build
build-release:
cargo build --release --verbose
test:
cargo test --workspace --all-features --verbose
test-release:
cargo test --workspace --all-features --release --verbose
coverage:
cargo tarpaulin --verbose --workspace -o Html
build-time:
cargo +nightly clean
cargo +nightly build -Z timings
fmt:
cargo +nightly fmt -- --check
lint:
cargo clippy --workspace --all-features --all-targets -- -D warnings
# =================================== #
# RELEASE STUFF. DO NOT USE #
# =================================== #
# uses convco to figure out the next version
new_version := "$(convco version --bump)"
release:
git cliff -t "{{new_version}}" > CHANGELOG.md
cargo check
git checkout -b hac-release-v"{{new_version}}"
git add -A
git commit -m "chore(release): release hac v{{new_version}}"
git push --set-upstream origin hac-release-v"{{new_version}}"
@echo "waiting 10 seconds so github catches up"
sleep 10
gh pr create --draft --title "chore: release hac v{{new_version}}" --body "This is an CI auto-generated PR" --reviewer wllfaria
echo "generated release pull request successfully"
gh-release:
git tag -d "v{{new_version}}" || echo "tag not found, creating"
git tag --sign -a "v{{new_version}}" -m "auto generated by the justfile for hac v$(convco version)"
just cross
mkdir -p ./target/"release-notes-$(convco version)"
git cliff -t "v$(convco version)" --current > ./target/"release-notes-$(convco version)/RELEASE.md"
just checksum >> ./target/"release-notes-$(convco version)/RELEASE.md"
git push origin "v{{new_version}}"
gh release create "v$(convco version)" --target "$(git rev-parse HEAD)" --title "hac v$(convco version)" -d -F ./target/"release-notes-$(convco version)/RELEASE.md" ./target/"bin-$(convco version)"/*
checksum:
@echo "# Checksums"
@echo "## sha256sum"
@echo '```'
@sha256sum ./target/"bin-$(convco version)"/*
@echo '```'
@echo "## md5sum"
@echo '```'
@md5sum ./target/"bin-$(convco version)"/*
@echo '```'
@echo "## blake3sum"
@echo '```'
@b3sum ./target/"bin-$(convco version)"/*
@echo '```'
tar BINARY TARGET:
tar czvf ./target/"bin-$(convco version)"/{{BINARY}}_{{TARGET}}.tar.gz -C ./target/{{TARGET}}/release/ ./{{BINARY}}
zip BINARY TARGET:
zip -j ./target/"bin-$(convco version)"/{{BINARY}}_{{TARGET}}.zip ./target/{{TARGET}}/release/{{BINARY}}
tar_static BINARY TARGET:
tar czvf ./target/"bin-$(convco version)"/{{BINARY}}_{{TARGET}}_static.tar.gz -C ./target/{{TARGET}}/release/ ./{{BINARY}}
zip_static BINARY TARGET:
zip -j ./target/"bin-$(convco version)"/{{BINARY}}_{{TARGET}}_static.zip ./target/{{TARGET}}/release/{{BINARY}}
binary BINARY TARGET:
rustup target add {{TARGET}}
cross build --release --target {{TARGET}}
just tar {{BINARY}} {{TARGET}}
just zip {{BINARY}} {{TARGET}}
binary_static BINARY TARGET:
rustup target add {{TARGET}}
RUSTFLAGS='-C target-feature=+crt-static' cross build --release --target {{TARGET}}
just tar_static {{BINARY}} {{TARGET}}
just zip_static {{BINARY}} {{TARGET}}
binary_no_libgit BINARY TARGET:
rustup target add {{TARGET}}
cross build --no-default-features --release --target {{TARGET}}
just tar {{BINARY}} {{TARGET}}
just zip {{BINARY}} {{TARGET}}
binary_static_no_libgit BINARY TARGET:
rustup target add {{TARGET}}
RUSTFLAGS='-C target-feature=+crt-static' cross build --no-default-features --release --target {{TARGET}}
just tar_static {{BINARY}} {{TARGET}}
just zip_static {{BINARY}} {{TARGET}}
cross:
# Setup Output Directory
mkdir -p ./target/"bin-$(convco version)"
rustup toolchain install stable
## Linux
### x86
just binary hac x86_64-unknown-linux-gnu
just binary_static hac x86_64-unknown-linux-gnu
just binary hac x86_64-unknown-linux-musl
just binary_static hac x86_64-unknown-linux-musl
### aarch
just binary_no_libgit hac aarch64-unknown-linux-gnu
just binary_static hac aarch64-unknown-linux-gnu
### arm
just binary_no_libgit hac arm-unknown-linux-gnueabihf
just binary_static hac arm-unknown-linux-gnueabihf
## Windows
### x86
just binary hac.exe x86_64-pc-windows-gnu
just binary_static hac.exe x86_64-pc-windows-gnu