From ea64d54ecc3bb1f6228cb60cc1480afaf20c006d Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Fri, 16 Jul 2021 23:26:30 +1000 Subject: [PATCH] Add gh publish patches --- .github/actions/build-tag.sh | 7 ++++++- .github/workflows/build.yml | 2 +- Makefile | 12 ++++++------ mk/spksrc.spk.mk | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/actions/build-tag.sh b/.github/actions/build-tag.sh index cd7bdc357e3..005686d994d 100755 --- a/.github/actions/build-tag.sh +++ b/.github/actions/build-tag.sh @@ -2,7 +2,7 @@ make setup-synocommunity sed -i -e "s|#PARALLEL_MAKE=.*|PARALLEL_MAKE=4|" \ - -e "s|PUBLISH_API_KEY=.*|PUBLISH_API_KEY=$API_KEY|" \ + -e "s|PUBLISH_API_KEY =.*|PUBLISH_API_KEY = $API_KEY|" \ local.mk # PACKAGE=$(echo "refs/tags/dnscrypt-proxy-2.0.42" | grep -oE "([0-9a-zA-Z]*-)*") @@ -12,3 +12,8 @@ echo "$GH_PACKAGE" # use TCVERSION and ARCH parameters to get real exit code. make TCVERSION=${GH_ARCH##*-} ARCH=${GH_ARCH%%-*} -C spk/${GH_PACKAGE} + +# publish to synocommunity.com when the API key is set +if [ -n "${API_KEY}" ]; then + make TCVERSION=${GH_ARCH##*-} ARCH=${GH_ARCH%%-*} publish -C spk/${GH_PACKAGE} +fi diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 89728691c9f..98e24b9b076 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -82,7 +82,7 @@ jobs: env: # https://github.com/SynoCommunity/spksrc/wiki/Compile-and-build-rules GH_ARCH: ${{ matrix.arch }} - # API_KEY: ${{ secrets.PUBLISH_API_KEY }} + API_KEY: ${{ secrets.PUBLISH_API_KEY }} BUILD_ERROR_FILE: /github/workspace/build_errors.txt BUILD_UNSUPPORTED_FILE: /github/workspace/build_unsupported.txt BUILD_SUCCESS_FILE: /github/workspace/build_success.txt diff --git a/Makefile b/Makefile index ff45402fcfd..3041ab25d94 100644 --- a/Makefile +++ b/Makefile @@ -169,10 +169,10 @@ dsm-%: local.mk @grep -q "^DEFAULT_TC.*=.*$*.*" local.mk || sed -i "/^DEFAULT_TC =/s/$$/ $*/" local.mk setup-synocommunity: setup - @sed -i -e "s|PUBLISH_URL=.*|PUBLISH_URL=https://api.synocommunity.com|" \ - -e "s|MAINTAINER?=.*|MAINTAINER?=SynoCommunity|" \ - -e "s|MAINTAINER_URL?=.*|MAINTAINER_URL?=https://synocommunity.com|" \ - -e "s|DISTRIBUTOR=.*|DISTRIBUTOR=SynoCommunity|" \ - -e "s|DISTRIBUTOR_URL=.*|DISTRIBUTOR_URL=https://synocommunity.com|" \ - -e "s|REPORT_URL=.*|REPORT_URL=https://github.com/SynoCommunity/spksrc/issues|" \ + @sed -i -e "s|PUBLISH_URL =.*|PUBLISH_URL = https://api.synocommunity.com|" \ + -e "s|MAINTAINER ?=.*|MAINTAINER ?= SynoCommunity|" \ + -e "s|MAINTAINER_URL ?=.*|MAINTAINER_URL ?= https://synocommunity.com|" \ + -e "s|DISTRIBUTOR =.*|DISTRIBUTOR = SynoCommunity|" \ + -e "s|DISTRIBUTOR_URL =.*|DISTRIBUTOR_URL = https://synocommunity.com|" \ + -e "s|REPORT_URL =.*|REPORT_URL = https://github.com/SynoCommunity/spksrc/issues|" \ local.mk diff --git a/mk/spksrc.spk.mk b/mk/spksrc.spk.mk index 6759082b8c1..b915291dbc1 100644 --- a/mk/spksrc.spk.mk +++ b/mk/spksrc.spk.mk @@ -375,7 +375,7 @@ endif ifeq ($(PUBLISH_API_KEY),) $(error Set PUBLISH_API_KEY in local.mk) endif - http --verify=no --auth $(PUBLISH_API_KEY): POST $(PUBLISH_URL)/packages @$(SPK_FILE_NAME) + http --verify=no --ignore-stdin --auth $(PUBLISH_API_KEY): POST $(PUBLISH_URL)/packages @$(SPK_FILE_NAME) ### Clean rules