diff --git a/.drone.yml b/.drone.yml index 480ea53..9ad18bc 100644 --- a/.drone.yml +++ b/.drone.yml @@ -69,12 +69,13 @@ steps: curl -H "Authorization: token $PACKAGE_UPLOAD_TOKEN" \ --upload-file "/_cache/bin/$PACKAGE_BASENAME" \ "$PACKAGE_UPLOAD_URL/$DRONE_TAG/$PACKAGE_BASENAME" - # - | - # for deb in /_cache/bin/*.deb; do - # curl -H "Authorization: token $PACKAGE_UPLOAD_TOKEN" \ - # --upload-file "$deb" \ - # "$PACKAGE_UPLOAD_URL/$DRONE_TAG/$(basename $deb)" - # done + - | + for deb in /_cache/bin/*.deb 0 ; do \ + test -f "$deb" || continue ; \ + curl -H "Authorization: token $PACKAGE_UPLOAD_TOKEN" \ + --upload-file "$deb" \ + "$PACKAGE_UPLOAD_URL/$DRONE_TAG/$(basename $deb)" ; \ + done - | set -x curl -X POST \ @@ -100,16 +101,17 @@ steps: -H "Content-Type: multipart/form-data" \ -F "attachment=@/_cache/bin/$PACKAGE_BASENAME" \ "$RELEASES_URL/$TAG_ID/assets?name=$PACKAGE_BASENAME" - # - | - # set -x - # for deb in /_cache/bin/*.deb; do - # curl -X POST \ - # -H "Authorization: token $RELEASE_UPLOAD_TOKEN" \ - # -H "accept: application/json" \ - # -H "Content-Type: multipart/form-data" \ - # -F "attachment=@$deb" \ - # "$RELEASES_URL/$TAG_ID/assets?name=$(basename $deb)" - # done + - | + set -x + for deb in /_cache/bin/*.deb 0 ; do \ + test -f "$deb" || continue ; \ + curl -X POST \ + -H "Authorization: token $RELEASE_UPLOAD_TOKEN" \ + -H "accept: application/json" \ + -H "Content-Type: multipart/form-data" \ + -F "attachment=@$deb" \ + "$RELEASES_URL/$TAG_ID/assets?name=$(basename $deb)" ; \ + done # FIXME: handle multi-arch diff --git a/Makefile b/Makefile index a371ae2..999feee 100644 --- a/Makefile +++ b/Makefile @@ -6,11 +6,14 @@ DESTDIR= PREFIX=$(DESTDIR)/usr +.PHONY: all all: build +.PHONY: prepare prepare: shards install +.PHONY: build build: shards build --error-trace -Dpreview_mt @echo SUCCESS @@ -18,10 +21,12 @@ build: watch: watchexec --restart --delay-run 3 -c -e cr make build +.PHONY: spec test spec: test test: crystal spec --error-trace +.PHONY: install install: install \ -D \ @@ -29,5 +34,7 @@ install: bin/mfm \ $(PREFIX)/bin/mfm -.PHONY: spec test build all prepare install +.PHONY: deb +deb: + dpkg-buildpackage -us -uc -d