Skip to content

Commit 1bc9cfa

Browse files
committed
GitHub Action: Added the ability to publish to syncocommunity
1 parent 9889754 commit 1bc9cfa

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.github/actions/build-tag.sh

+5
Original file line numberDiff line numberDiff line change
@@ -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

+4-2
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
@@ -109,7 +109,9 @@ jobs:
109109
release:
110110
needs: build
111111
name: Release
112-
if: startsWith(github.ref, 'refs/tags/')
112+
## Build a github release on a git tag with the format 'packagename-version'
113+
## But don't make a github release when the PUBLISH_API_KEY is set.
114+
if: startsWith(github.ref, 'refs/tags/') && secrets.PUBLISH_API_KEY == ''
113115
runs-on: ubuntu-latest
114116
steps:
115117
- name: Download build artifacts

0 commit comments

Comments
 (0)