Skip to content

Commit

Permalink
ci: fix upload to delon-builds when push (#1783)
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk authored Mar 14, 2024
1 parent 905014b commit 502faee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
env:
ACCESS_TOKEN: ${{ secrets.CI_TOKEN }}
MESSAGE: ${{ github.event.pull_request.title || github.event.head_commit.message }}
BRANCH: ${{ github.ref_name }}
- name: Build site
run: yarn run site:build
- name: 'Deploy Site'
Expand Down
21 changes: 7 additions & 14 deletions scripts/ci/build-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

set -e

if [ -z ${ACCESS_TOKEN} ]; then
echo "Error: No access token for GitHub could be found." \
"Please set the environment variable 'ACCESS_TOKEN'."
exit 0
fi

readonly thisDir=$(cd $(dirname $0); pwd)

commitSha=$(git rev-parse --short HEAD)
Expand All @@ -17,19 +23,6 @@ cd $(dirname $0)/../..

DIST="$(pwd)/dist"

# if [[ ${commitAuthorName} != '卡色' && ${commitAuthorName} != 'cipchk' ]]; then
# echo "Warning: Just only 卡色 or cipchk user"
# exit 0
# fi

# echo "ACCESS_TOKEN: ${ACCESS_TOKEN}.."

if [ -z ${ACCESS_TOKEN} ]; then
echo "Error: No access token for GitHub could be found." \
"Please set the environment variable 'ACCESS_TOKEN'."
exit 0
fi

buildDir=${DIST}/publish
rm -rf ${buildDir}
mkdir -p ${buildDir}
Expand All @@ -38,7 +31,7 @@ cp -r ${DIST}/ng-alain ${buildDir}/ng-alain

packageRepo=delon-builds
buildVersion=$(node -pe "require('./package.json').version")
branchName=${TRAVIS_BRANCH:-'master'}
branchName=${BRANCH:-'master'}

buildVersionName="${buildVersion}-${commitSha}"
buildTagName="${branchName}-${commitSha}"
Expand Down

0 comments on commit 502faee

Please sign in to comment.