Skip to content
This repository was archived by the owner on Apr 30, 2025. It is now read-only.

Commit 92ad2a9

Browse files
committed
Clean up release script and expose through makefile
1 parent 3550937 commit 92ad2a9

File tree

4 files changed

+35
-21
lines changed

4 files changed

+35
-21
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ script:
66
- SPINC="./openspin -q" make -j
77
- make clean
88
- rm ./openspin -f
9-
- ./scripts/release.sh ${TRAVIS_TAG}
9+
- RELEASE_TAG=${TRAVIS_TAG} make release
1010

1111
after_script:
1212
- ls *.zip

makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ clean:
2020
rm -f $(BINARIES) $(ZIPS)
2121
rm -rf $(PREFIX)
2222

23-
build_media:
24-
./media/media.sh
23+
media:
24+
./library/media/media.sh
25+
26+
release:
27+
./scripts/release.py $(RELEASE_TAG)
2528

2629
test: test_compile
2730

packthing.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ target:
3030
run: lslauncher
3131

3232
repos:
33+
lamestation-sdk:
34+
url: https://github.com/lamestation/lamestation-sdk.git
35+
builder: dir
36+
root: library
37+
3338
lslauncher:
3439
url: https://github.com/lamestation/lslauncher.git
3540
builder: qmake
@@ -38,12 +43,6 @@ repos:
3843
name: LameStudio
3944
icon: icons/seal.png
4045

41-
lamestation-sdk:
42-
url: https://github.com/lamestation/lamestation-sdk.git
43-
builder: dir
44-
root: library
45-
tag: 0.6.1-rc2
46-
4746
propelleride:
4847
url: https://github.com/parallaxinc/PropellerIDE.git
4948
builder: qmake

scripts/release.py

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
import fnmatch
88
import re
99

10-
1110
def zipdir(path, ziph):
1211
for root, dirs, files in os.walk(path):
1312
for file in files:
1413
ziph.write(os.path.join(root, file))
1514

1615
def mkdir(path):
16+
print 'dir', path
1717
try:
1818
os.makedirs(path)
1919
except OSError as exc: # Python >2.5
@@ -28,6 +28,17 @@ def purge(directory, pattern):
2828
print "del", os.path.join(root, filename)
2929
os.remove(os.path.join(root, filename))
3030

31+
def command(cmd):
32+
try:
33+
out = subprocess.check_output(cmd)
34+
except subprocess.CalledProcessError as e:
35+
print "Error: Command failed"
36+
sys.exit(1)
37+
return out
38+
39+
40+
41+
3142
version = 'master'
3243

3344
if len(sys.argv) > 1:
@@ -36,8 +47,10 @@ def purge(directory, pattern):
3647
release = "lamestation-sdk-"+version
3748
archive = release+".zip"
3849
builddir = ".build"
50+
docsdir = os.path.join(builddir, 'docs')
3951

40-
print release
52+
print 'version', version
53+
print 'release', release
4154

4255
try:
4356
shutil.rmtree(builddir)
@@ -49,14 +62,11 @@ def purge(directory, pattern):
4962
purge(builddir, "*.xcf")
5063
purge(builddir, "*.svg")
5164

52-
def command(cmd):
53-
try:
54-
out = subprocess.check_output(cmd)
55-
except subprocess.CalledProcessError as e:
56-
print "Error: Command failed"
57-
sys.exit(1)
58-
return out
59-
65+
mkdir(docsdir)
66+
print 'wget'
67+
command(['wget','-4','-q','-O',
68+
os.path.join(docsdir,'lamestation-book-'+version+'.pdf'),
69+
'https://www.gitbook.com/download/pdf/book/bweir/lamestation-book'])
6070

6171
files = command(["git","ls-tree","-r",version,"--name-only"]).splitlines()
6272
files = [f for f in files if re.match(r'.*\.spin', f)]
@@ -76,7 +86,7 @@ def command(cmd):
7686
filename = os.sep.join(filecomps)
7787
newfilename = os.path.join(builddir, filename)
7888

79-
print line
89+
print 'meta', line
8090
logs = command(["git","log", "--format=%aD","--follow", line]).splitlines()
8191
today = logs[0].split()[3]
8292
created = logs[-1].split()[3]
@@ -116,9 +126,11 @@ def command(cmd):
116126
except:
117127
pass
118128

119-
print "Building zip:",archive
129+
print 'zip', archive
120130
zipf = zipfile.ZipFile(archive, 'w', zipfile.ZIP_DEFLATED)
121131
zipdir(release, zipf)
122132
zipf.close()
123133

124134
shutil.move(release, builddir)
135+
136+
print 'done'

0 commit comments

Comments
 (0)