-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
86 lines (77 loc) · 2.56 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
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
# Release procedure
# =================
#
# $ git tag -l
# $ git tag VERSION_HERE
# $ make
# $ make upload
# $ git log -p origin/master..
# $ git push --tags origin master:master
#
# Process logs and print download counter
# =======================================
#
# $ make downloads
VER = $(shell git describe --tags)
BAREVER = $(shell echo $(VER) | tail -c+2)
DMG107 = YandexMusicMacPlayer-$(VER)-10.7.dmg
DMG108 = YandexMusicMacPlayer-$(VER)-10.8.dmg
LASTTAG = $(shell git describe --abbrev=0 --tags)
LASTTAGDATE = $(shell git log -1 --format=%ad --date=short $(LASTTAG))
dmg:
if [ -a $(DMG107) ] ; \
then \
echo error: $(DMG107) already exists ; \
exit 1 ; \
else \
make dmgver VER=$(VER) OSVER=10.7; \
fi ; \
if [ -a $(DMG108) ] ; \
then \
echo error: $(DMG108) already exists ; \
exit 1 ; \
else \
make dmgver VER=$(VER) OSVER=10.8 ; \
fi
# usage: make dmgver VER=v0.2.0 OSVER=10.7
dmgver: YandexMusicMacPlayer.dmg
mv YandexMusicMacPlayer.dmg YandexMusicMacPlayer-$(VER)-$(OSVER).dmg
YandexMusicMacPlayer.dmg: build/Release/YandexMusic.app
mv build/Release/YandexMusic.app build/Release/Yandex\ Music\ Player.app
scripts/pkg-dmg \
--verbosity 2 \
--volname "Yandex Music Player" \
--source build/Release/Yandex\ Music\ Player.app \
--sourcefile \
--target YandexMusicMacPlayer.dmg \
--icon build/Release/Yandex\ Music\ Player.app/Contents/Resources/app.icns \
--copy scripts/mozilla.dsstore:.DS_Store \
--mkdir .background \
--copy scripts/mozilla-background.jpg:.background/backgroundImage.jpg \
--symlink /Applications:Applications \
--attribute V:.background \
--idme
rm -rf build/Release/Yandex\ Music\ Player.app
build/Release/YandexMusic.app:
xcodebuild MACOSX_DEPLOYMENT_TARGET=$(OSVER)
upload:
git diff --exit-code README.markdown
@if [ $(LASTTAG) != $(VER) ] ; then \
echo error: last commit not tagged ; \
exit 1 ; \
fi
s3cmd put -P $(DMG107) s3://YandexMusicMacPlayer
s3cmd put -P $(DMG108) s3://YandexMusicMacPlayer
sed -i -e 's/\(\[changelog\]: .*\/compare\/\)\(.*\)\.\.\.\(.*\)/\1\3\.\.\.$(VER)/' README.markdown
sed -i -e 's/\(\[10\.7\]: http.*\/\).*/\1$(DMG107)/' README.markdown
sed -i -e 's/\(\[10\.8\]: http.*\/\).*/\1$(DMG108)/' README.markdown
sed -i -e 's/\(#### Latest release\) (.*)/\1 ($(BAREVER), $(LASTTAGDATE))/' README.markdown
git commit -m 'update download links to $(VER)' README.markdown
downloads:
mkdir -p logs/
scripts/process-s3-logs
scripts/show-downloads | wc -l
clean:
xcodebuild clean
rm -rf build
.PHONY: dmg clean upload updatelinks