Skip to content

Commit

Permalink
fix: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
louis030195 committed Jul 31, 2024
1 parent d317cdb commit ba10e89
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- uses: actions/cache@v3
with:
path: |
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
Expand All @@ -64,13 +64,16 @@ jobs:
# get the current tag or take latest (in the case of a workflow dispatch)
- name: Set version
run: |
VERSION=${GITHUB_REF#refs/tags/}
if [[ $VERSION != v* ]]; then
git fetch --tags
VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
else
VERSION=$(git ls-remote --tags --refs --sort="version:refname" | tail -n1 | sed 's/.*\///' | sed 's/^v//')
fi
if [[ -z "$VERSION" ]]; then
VERSION="0.0.0"
fi
VERSION=${VERSION#v}
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Set version to: $VERSION"
- name: Create deployment package
run: |
Expand Down

0 comments on commit ba10e89

Please sign in to comment.