Skip to content

Commit

Permalink
Add gh publish patches
Browse files Browse the repository at this point in the history
  • Loading branch information
publicarray committed Jul 16, 2021
1 parent 156f21f commit ea64d54
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
7 changes: 6 additions & 1 deletion .github/actions/build-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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]*-)*")
Expand All @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion mk/spksrc.spk.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ea64d54

Please sign in to comment.