-
Notifications
You must be signed in to change notification settings - Fork 8
/
makefile
52 lines (41 loc) · 1.54 KB
/
makefile
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
WINDOWS_TARGET := x86_64-pc-windows-msvc
LINUX_TARGET := x86_64-unknown-linux-gnu
VERSION := $(shell sed -nE 's/^version\s?=\s?"(.*)"/\1/p' Cargo.toml)
.PHONY: none release win linux deb gh publish changelog fedora tty
none:
@echo 'Explictly select "release" option'
release: linux
@mkdir -p "release/$(VERSION)"
cp "target/$(LINUX_TARGET)/github/nyaa" "release/$(VERSION)/nyaa-$(VERSION)-$(LINUX_TARGET)"
@echo "Commits since last tag:"
@git log $(shell git describe --tags --abbrev=0)..HEAD --oneline
win:
cargo build --target $(WINDOWS_TARGET) --profile=github
linux:
cargo build --target $(LINUX_TARGET) --profile=github
github:
cargo build --profile=github
fedora: github
@mkdir -p "release/$(VERSION)"
cargo generate-rpm --profile github
cp target/generate-rpm/nyaa-$(VERSION)*.rpm "release/$(VERSION)/"
deb:
@mkdir -p "release/$(VERSION)"
@echo Go grab a coffee...
docker stop nyaa-deb || true
docker rm nyaa-deb || true
cd scripts; VERSION=$(VERSION) docker compose up
cp "scripts/docker-deb/nyaa-$(VERSION)-x86_64.deb" "release/$(VERSION)/"
gh:
gh release create v$(VERSION) release/$(VERSION)/* --draft --title v$(VERSION) --latest
changelog:
@echo "Adds:"
@git log $(shell git describe --tags --abbrev=0)..HEAD --oneline | sed -n 's/^.\+feat(\(.\+\))\?:\s\+/- /p'
@echo
@echo "Fixes:"
@git log $(shell git describe --tags --abbrev=0)..HEAD --oneline | sed -n 's/^.\+fix(\(.\+\))\?:\s\+/- /p'
tty:
vhs ./scripts/tty.tape
publish:
@echo -n "Publish v$(VERSION) to crates.io? [y/N] " && read ans && [ $${ans:-N} = y ]
cargo publish