Skip to content

Commit ea64d54

Browse files
committed
Add gh publish patches
1 parent 156f21f commit ea64d54

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

.github/actions/build-tag.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
make setup-synocommunity
44
sed -i -e "s|#PARALLEL_MAKE=.*|PARALLEL_MAKE=4|" \
5-
-e "s|PUBLISH_API_KEY=.*|PUBLISH_API_KEY=$API_KEY|" \
5+
-e "s|PUBLISH_API_KEY =.*|PUBLISH_API_KEY = $API_KEY|" \
66
local.mk
77

88
# PACKAGE=$(echo "refs/tags/dnscrypt-proxy-2.0.42" | grep -oE "([0-9a-zA-Z]*-)*")
@@ -12,3 +12,8 @@ echo "$GH_PACKAGE"
1212

1313
# use TCVERSION and ARCH parameters to get real exit code.
1414
make TCVERSION=${GH_ARCH##*-} ARCH=${GH_ARCH%%-*} -C spk/${GH_PACKAGE}
15+
16+
# publish to synocommunity.com when the API key is set
17+
if [ -n "${API_KEY}" ]; then
18+
make TCVERSION=${GH_ARCH##*-} ARCH=${GH_ARCH%%-*} publish -C spk/${GH_PACKAGE}
19+
fi

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
env:
8383
# https://github.com/SynoCommunity/spksrc/wiki/Compile-and-build-rules
8484
GH_ARCH: ${{ matrix.arch }}
85-
# API_KEY: ${{ secrets.PUBLISH_API_KEY }}
85+
API_KEY: ${{ secrets.PUBLISH_API_KEY }}
8686
BUILD_ERROR_FILE: /github/workspace/build_errors.txt
8787
BUILD_UNSUPPORTED_FILE: /github/workspace/build_unsupported.txt
8888
BUILD_SUCCESS_FILE: /github/workspace/build_success.txt

Makefile

+6-6
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,10 @@ dsm-%: local.mk
169169
@grep -q "^DEFAULT_TC.*=.*$*.*" local.mk || sed -i "/^DEFAULT_TC =/s/$$/ $*/" local.mk
170170

171171
setup-synocommunity: setup
172-
@sed -i -e "s|PUBLISH_URL=.*|PUBLISH_URL=https://api.synocommunity.com|" \
173-
-e "s|MAINTAINER?=.*|MAINTAINER?=SynoCommunity|" \
174-
-e "s|MAINTAINER_URL?=.*|MAINTAINER_URL?=https://synocommunity.com|" \
175-
-e "s|DISTRIBUTOR=.*|DISTRIBUTOR=SynoCommunity|" \
176-
-e "s|DISTRIBUTOR_URL=.*|DISTRIBUTOR_URL=https://synocommunity.com|" \
177-
-e "s|REPORT_URL=.*|REPORT_URL=https://github.com/SynoCommunity/spksrc/issues|" \
172+
@sed -i -e "s|PUBLISH_URL =.*|PUBLISH_URL = https://api.synocommunity.com|" \
173+
-e "s|MAINTAINER ?=.*|MAINTAINER ?= SynoCommunity|" \
174+
-e "s|MAINTAINER_URL ?=.*|MAINTAINER_URL ?= https://synocommunity.com|" \
175+
-e "s|DISTRIBUTOR =.*|DISTRIBUTOR = SynoCommunity|" \
176+
-e "s|DISTRIBUTOR_URL =.*|DISTRIBUTOR_URL = https://synocommunity.com|" \
177+
-e "s|REPORT_URL =.*|REPORT_URL = https://github.com/SynoCommunity/spksrc/issues|" \
178178
local.mk

mk/spksrc.spk.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ endif
375375
ifeq ($(PUBLISH_API_KEY),)
376376
$(error Set PUBLISH_API_KEY in local.mk)
377377
endif
378-
http --verify=no --auth $(PUBLISH_API_KEY): POST $(PUBLISH_URL)/packages @$(SPK_FILE_NAME)
378+
http --verify=no --ignore-stdin --auth $(PUBLISH_API_KEY): POST $(PUBLISH_URL)/packages @$(SPK_FILE_NAME)
379379

380380

381381
### Clean rules

0 commit comments

Comments
 (0)