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

fix: github action: auto release prefix sensitive #95

Merged
merged 1 commit into from
Feb 21, 2022
Merged
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
15 changes: 6 additions & 9 deletions .github/workflows/tag-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,29 @@ jobs:
run: |
export commit=$(git rev-parse HEAD)
export short=$(git rev-parse --short HEAD)
export github_tag=${GITHUB_REF##*/}
export github_tag=${{github.ref_name}}
export tag=$github_tag
export branch=$github_tag
export git_message=$(git rev-list --format=%s --max-count=1 HEAD | tail +2)
export repo_name=${GITHUB_REPOSITORY##*/}
export branch=$(git symbolic-ref --short -q HEAD)
export tag=$(git describe --tags $(git rev-list --tags --max-count=1))
export artifact_name=${repo_name}_$(git rev-parse --short HEAD).tar.gz
export pub_method=pushTest
export job_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID
export oss_exists=0
export ftp_exists=0

export rx='^v([0-9]+\.){0,2}(\*|[0-9]+)(-rc[0-9]*){0,1}$'
if [[ "${{github.ref_type}}" == "tag" ]] && [[ "${{github.event_name}}" == "create" ]] && [[ "$github_tag" =~ $rx ]]; then
export pub_method=pushRelease
fi
if [[ "$branch" == "" ]]; then
export branch=$github_tag
fi
if [[ "$tag" == "" ]]; then
export tag=$github_tag
fi

if [[ "${{secrets.OSS_KEY_ID}}" != "" && \
"${{secrets.OSS_KEY_SECRET}}" != "" && \
"${{secrets.OSS_ENDPOINT}}" != "" && \
"${{secrets.OSS_BUCKET}}" != "" ]]; then
export oss_exists=1
fi

if [[ "${{secrets.FTP_HOST}}" != "" ]]; then
export ftp_exists=1
fi
Expand Down