|
1 | 1 | VERSION=master |
2 | 2 |
|
3 | | -all: build/GXWriter-$(VERSION).curapackage build/FlashforgeFinderIntegration-$(VERSION).curapackage |
| 3 | +all: build |
4 | 4 |
|
5 | 5 | clean: |
6 | 6 | rm -rf build |
7 | 7 |
|
| 8 | +build: build-gxwriter build-ffintegration |
| 9 | + |
| 10 | +build-gxwriter: build/GXWriter-$(VERSION).curapackage |
8 | 11 | build/GXWriter-$(VERSION).curapackage: plugins/GXWriter/* LICENSE icon.png |
9 | 12 | mkdir -p build/GXWriter/files/plugins |
10 | 13 | cp LICENSE icon.png build/GXWriter |
11 | 14 | cp -r plugins/GXWriter/ build/GXWriter/files/plugins/ |
12 | 15 | mv build/GXWriter/files/plugins/GXWriter/package.json build/GXWriter/ |
| 16 | + sed -i -e 's/"version":.*/"version": "$(VERSION)"/g' build/GXWriter/files/plugins/GXWriter/plugin.json |
| 17 | + sed -i -e 's/"package_version":.*/"package_version": "$(VERSION)"/g' build/GXWriter/package.json |
13 | 18 | cd build/GXWriter && \ |
14 | 19 | zip ../GXWriter-$(VERSION).curapackage -q \ |
15 | 20 | -x "*testdata*" \ |
16 | 21 | -x "*__pycache__*" \ |
17 | 22 | -x "*pyc" \ |
18 | 23 | -r . |
19 | 24 |
|
| 25 | +build-ffintegration: build/FlashforgeFinderIntegration-$(VERSION).curapackage |
20 | 26 | build/FlashforgeFinderIntegration-$(VERSION).curapackage: plugins/FlashforgeFinderIntegration/* LICENSE icon.png |
21 | 27 | mkdir -p build/FlashforgeFinderIntegration/files/plugins |
22 | 28 | cp LICENSE icon.png build/FlashforgeFinderIntegration |
23 | 29 | cp -r plugins/FlashforgeFinderIntegration/ build/FlashforgeFinderIntegration/files/plugins/ |
24 | 30 | mv build/FlashforgeFinderIntegration/files/plugins/FlashforgeFinderIntegration/package.json build/FlashforgeFinderIntegration/ |
| 31 | + sed -i -e 's/"version":.*/"version": "$(VERSION)"/g' build/FlashforgeFinderIntegration/files/plugins/FlashforgeFinderIntegration/plugin.json |
| 32 | + sed -i -e 's/"package_version":.*/"package_version": "$(VERSION)"/g' build/FlashforgeFinderIntegration/package.json |
25 | 33 | cd build/FlashforgeFinderIntegration && \ |
26 | 34 | zip ../FlashforgeFinderIntegration-$(VERSION).curapackage -q \ |
27 | 35 | -x "*testdata*" \ |
28 | 36 | -x "*__pycache__*" \ |
29 | 37 | -x "*pyc" \ |
30 | 38 | -r . |
| 39 | + |
| 40 | +release: build/GXWriter-$(VERSION).curapackage build/FlashforgeFinderIntegration-$(VERSION).curapackage |
| 41 | + if [ x"$(VERSION)" = x"master" ] ; then echo "Unable to release from master. Use make VERSION=X.Y.Z" ; exit 1; fi |
| 42 | + git tag v$(VERSION) |
| 43 | + git push --tags |
0 commit comments