Skip to content

Commit a888ab5

Browse files
committed
feat: use systemd container to build release
1 parent e0c34fb commit a888ab5

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

Makefile

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
11
SHELL := /usr/bin/env bash
22
VERSION := $(shell cat pubspec.yaml | grep "^version: " | cut -c 10- | sed 's/+/\-/')
3+
SHORT_VERSION := $(shell xx="$(VERSION)"; arrVersion=($${xx//-/ }); echo $${arrVersion[0]};)
34
BUILD_ROOT := ../build-package
4-
BASE_NAME := quickgui-$(VERSION)
5+
BASE_NAME := quickgui-$(SHORT_VERSION)
56
BUILD_DIR := $(BUILD_ROOT)/$(BASE_NAME)
67
BIN_TAR := $(BUILD_ROOT)/$(BASE_NAME).tar
78
SRC_TAR := $(BUILD_ROOT)/$(BASE_NAME)-src.tar
89
FLUTTER := /opt/flutter/bin/flutter
910

10-
all: version bin
11-
1211
version:
1312
@echo VERSION is $(VERSION)
13+
@echo SHORT_VERSION is $(SHORT_VERSION)
1414
@echo BUILD_ROOT is $(BUILD_ROOT)
15+
@echo type "make bin" to create binary package
16+
@echo type "make ppa" to upload to launchpad
17+
18+
spawn:
19+
echo "#! /bin/env bash" > /home/yannick/machines/focal/home/yannick/build.sh
20+
echo "" >> /home/yannick/machines/focal/home/yannick/build.sh
21+
echo "cd /opt/flutter-projects/quickgui" >> /home/yannick/machines/focal/home/yannick/build.sh
22+
echo "make bin" >> /home/yannick/machines/focal/home/yannick/build.sh
23+
sudo systemd-nspawn -D /home/yannick/machines/focal --resolv-conf=off --bind-ro=/home/yannick/machines/resolv.conf:/etc/resolv.conf --bind=/opt/flutter:/opt/flutter --bind=/opt/flutter-projects:/opt/flutter-projects -u yannick bash /home/yannick/build.sh
1524

1625
distclean:
1726
$(FLUTTER) clean
18-
rm -rf $(BUILD_ROOT)
27+
rm -rf $(BUILD_ROOT)/*
1928

2029
quickgui: distclean
2130
$(FLUTTER) pub get
@@ -28,6 +37,23 @@ bin: quickgui
2837
tar -C $(BUILD_ROOT) -c -v --exclude "quickemu-icons/*.png" -f $(BIN_TAR) $(BASE_NAME)
2938
xz -z $(BIN_TAR)
3039

40+
ppa: version
41+
cp $(BIN_TAR).xz /mnt/data/dev/debianpackages/quickgui.deb/
42+
cd /mnt/data/dev/debianpackages/quickgui.deb/quickgui ; \
43+
dch -v $(VERSION) "New changelog message" ; \
44+
vi debian/changelog ; \
45+
for dist in focal jammy kinetic; do \
46+
sed -i "1 s/^\(.*\)) UNRELEASED;\(.*\)\$$/\1~xxx1.0) xxx;\2/g" debian/changelog ; \
47+
sed -i "1 s/~.*1\.0) .*;\(.*\)\$$/~$${dist}1.0) $$dist;\1/g" debian/changelog ; \
48+
dpkg-buildpackage -d -S -sa ; \
49+
dput ppa:yannick-mauray/quickgui ../quickgui_$(VERSION)~$${dist}1.0_source.changes ; \
50+
done
51+
52+
download: version
53+
for dist in focal jammy kinetic; do \
54+
aria2c https://launchpad.net/~yannick-mauray/+archive/ubuntu/quickgui/+files/quickgui_$(VERSION)~$${dist}1.0_amd64.deb; \
55+
done
56+
3157
src:
3258
mkdir -p $(BUILD_ROOT)
3359
tar -C .. -c -v -f $(SRC_TAR) --exclude .git --transform 's/^quickgui/$(BASE_NAME)/' quickgui

0 commit comments

Comments
 (0)