Skip to content

Commit 70f06d5

Browse files
authored
Update publish recipe (#543)
1 parent fd807f0 commit 70f06d5

File tree

1 file changed

+60
-67
lines changed

1 file changed

+60
-67
lines changed

justfile

Lines changed: 60 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -12,128 +12,121 @@ export RUST_LOG := log
1212

1313
# watch filesystem for changes and rerun tests
1414
watch +ARGS='test':
15-
cargo watch --clear --exec '{{ARGS}}'
15+
cargo watch --clear --exec '{{ARGS}}'
1616

1717
# show stats about torrents at `PATH`
1818
stats PATH:
19-
cargo build --release
20-
time ./target/release/imdl --unstable torrent stats --input {{PATH}}
19+
cargo build --release
20+
time ./target/release/imdl --unstable torrent stats --input {{PATH}}
2121

2222
push:
23-
! git branch | grep '* master'
24-
git push github
23+
! git branch | grep '* master'
24+
git push github
2525

2626
# clean up feature branch BRANCH
2727
done BRANCH=`git rev-parse --abbrev-ref HEAD`:
28-
git push github {{BRANCH}}:master
29-
git rebase github/master master
30-
git branch -d {{BRANCH}}
28+
git push github {{BRANCH}}:master
29+
git rebase github/master master
30+
git branch -d {{BRANCH}}
3131

3232
test:
33-
cargo test --all
33+
cargo test --all
3434

3535
clippy:
36-
cargo clippy --all-targets --all-features
36+
cargo clippy --all-targets --all-features
3737

3838
fmt:
39-
cargo +nightly fmt --all
39+
cargo +nightly fmt --all
4040

4141
forbid:
42-
./bin/forbid
42+
./bin/forbid
4343

4444
preview-readme:
45-
grip -b README.md
45+
grip -b README.md
4646

4747
# build and serve the book
4848
book:
49-
mdbook serve book --open --dest-dir ../www/book
49+
mdbook serve book --open --dest-dir ../www/book
5050

5151
dev-deps:
52-
brew install grip
53-
cargo install mdbook
54-
cargo install cargo-watch
55-
npm install --global asciicast2gif
56-
brew install imagemagick
57-
brew install gifsicle
52+
brew install grip
53+
cargo install mdbook
54+
cargo install cargo-watch
55+
npm install --global asciicast2gif
56+
brew install imagemagick
57+
brew install gifsicle
5858

5959
# update generated documentation
6060
gen:
61-
cargo build
62-
cargo run --package gen -- --bin target/debug/imdl all
61+
cargo build
62+
cargo run --package gen -- --bin target/debug/imdl all
6363

6464
check-minimal-versions:
65-
./bin/check-minimal-versions
65+
./bin/check-minimal-versions
6666

6767
check: test clippy forbid check-minimal-versions gen
68-
git diff --no-ext-diff --quiet --exit-code
69-
cargo +nightly fmt --all -- --check
68+
git diff --no-ext-diff --quiet --exit-code
69+
cargo +nightly fmt --all -- --check
7070

7171
draft: push
72-
hub pull-request -o --draft
72+
hub pull-request -o --draft
7373

7474
pr: check push
75-
hub pull-request -o
76-
77-
merge BRANCH=`git rev-parse --abbrev-ref HEAD`:
78-
#!/usr/bin/env bash
79-
set -euxo pipefail
80-
while ! hub ci-status --verbose {{BRANCH}}; do
81-
sleep 5
82-
done
83-
just done {{BRANCH}}
84-
85-
publish-check: check
86-
cargo outdated --exit-code 1
87-
grep '^\[{{version}}\]' target/gen/CHANGELOG.md
88-
89-
publish BRANCH=`git rev-parse --abbrev-ref HEAD`: publish-check (merge BRANCH)
90-
#!/usr/bin/env bash
91-
set -euxo pipefail
92-
git tag -a {{version}} -m 'Release {{version}}'
93-
git push github {{version}}
94-
while ! hub ci-status --verbose {{BRANCH}}; do
95-
sleep 5
96-
done
97-
cargo publish
75+
hub pull-request -o
76+
77+
publish:
78+
#!/usr/bin/env bash
79+
set -euxo pipefail
80+
rm -rf tmp/release
81+
git clone git@github.com:casey/intermodal.git tmp/release
82+
cd tmp/release
83+
cargo build
84+
cargo run --package gen -- --bin target/debug/imdl all
85+
VERSION=v`sed -En 's/version[[:space:]]*=[[:space:]]*"([^"]+)"/\1/p' Cargo.toml | head -1`
86+
git tag -a $VERSION -m "Release $VERSION"
87+
git push origin $VERSION
88+
cargo publish
89+
cd ../..
90+
rm -rf tmp/release
9891

9992
# record, upload, and render demo animation
10093
demo: demo-record demo-upload demo-render
10194

10295
demo-record:
103-
#!/usr/bin/env bash
104-
set -euxo pipefail
105-
cargo build --release --all
106-
rm -f tmp/9front.torrent
107-
asciinema rec \
108-
--title "Intermodal {{version}} Demo" \
109-
--command ./target/release/demo \
110-
--overwrite \
111-
tmp/demo.json
96+
#!/usr/bin/env bash
97+
set -euxo pipefail
98+
cargo build --release --all
99+
rm -f tmp/9front.torrent
100+
asciinema rec \
101+
--title "Intermodal {{version}} Demo" \
102+
--command ./target/release/demo \
103+
--overwrite \
104+
tmp/demo.json
112105

113106
demo-upload:
114-
asciinema upload tmp/demo.json
107+
asciinema upload tmp/demo.json
115108

116109
demo-render:
117-
../asciicast2gif/asciicast2gif -S4 tmp/demo.json www/demo.gif
110+
../asciicast2gif/asciicast2gif -S4 tmp/demo.json www/demo.gif
118111

119112
# print commit metadata types
120113
commit-types:
121-
cargo run --package gen -- --bin target/debug/imdl commit-types
114+
cargo run --package gen -- --bin target/debug/imdl commit-types
122115

123116
# open site index
124117
www:
125-
open www/index.html
118+
open www/index.html
126119

127120
# retrieve large collection of torrents from the Internet Archive
128121
get-torrents:
129-
aria2c \
130-
-d dat \
131-
-x 10 \
132-
'https://ia802701.us.archive.org/21/items/2014_torrent_archive_organized/torrent_archive_organized.zip'
122+
aria2c \
123+
-d dat \
124+
-x 10 \
125+
'https://ia802701.us.archive.org/21/items/2014_torrent_archive_organized/torrent_archive_organized.zip'
133126

134127
# download bittorrent.org repository
135128
get-beps:
136-
git clone git@github.com:bittorrent/bittorrent.org.git tmp/bittorrent.org
129+
git clone git@github.com:bittorrent/bittorrent.org.git tmp/bittorrent.org
137130

138131
build-image:
139132
podman build -t imdl .

0 commit comments

Comments
 (0)