Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix upload to delon-builds when push #1783

Merged
merged 2 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading