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: update git workflow #4799

Merged
merged 1 commit into from
Feb 23, 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
18 changes: 7 additions & 11 deletions .github/workflows/tag-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ 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
Expand All @@ -40,12 +40,7 @@ jobs:
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}}" != "" && \
Expand Down Expand Up @@ -117,6 +112,7 @@ jobs:
id: release
uses: ncipollo/release-action@v1
if: ${{ steps.vars.outputs.pub_method=='pushRelease' }}
continue-on-error: true
with:
artifacts: ${{steps.vars.outputs.artifact_name}}
tag: ${{ steps.vars.outputs.github_tag }}
Expand Down Expand Up @@ -151,12 +147,12 @@ jobs:
echo '::set-output name=oss_signed_url::$(signed_url)'

- name: upload artifacts
if: ${{ steps.vars.outputs.pub_method == 'pushTest' && steps.uploadftp.outcome != 'success' && steps.cposs.outcome != 'success' }}
if: ${{ steps.vars.outputs.pub_method == 'pushRelease' }}
continue-on-error: true
uses: actions/upload-artifact@v2
with:
name: ${{steps.vars.outputs.artifact_name}}
path: ./${{steps.vars.outputs.artifact_name}}
path: ./release
if-no-files-found: error

- name: push god-eye
Expand Down