Skip to content

Commit

Permalink
Add debugging, use sed instead of bash substitutions (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
esarver authored Mar 29, 2024
1 parent e93bb66 commit 41931a8
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,17 @@ jobs:
path: target/
- name: Get Tagged Version
id: lasttag
if: ${{ endsWith(github.base_ref, 'main') && (contains(github.head_ref, 'release/') || github.event.pull_request.merged) }}
run: |
git config --global --add safe.directory "$PWD"
apt-get update && apt-get install -yqq jq
COMMIT="${{github.sha}}"
if ${{contains(github.head_ref, 'release')}}; then
V="${{github.head_ref}}"
V="${V#release/}"
else
V="$(cargo metadata --format-version=1 --no-deps | jq '.packages[0].version')"
V=v${V//\"/} #remove '"'s
echo "Extracted version: $V"
V="$(echo "v${V}" | sed 's/\"//g')"
echo "Cleaned up version: $V"
fi
# Check to see if the version tag already exists
Expand All @@ -242,6 +242,7 @@ jobs:
# 2) This is a feature branch being merged into the main branch.
if ${{(! github.event.pull_request.merged && contains(github.head_ref, 'release/')) || (github.event.pull_request.merged && !contains(github.head_ref, 'release/'))}}; then
V="${V}-$(git tag --list ${V}* | wc -l)"
echo "RC Version: $V"
fi
CL=${V#v}
Expand Down Expand Up @@ -330,15 +331,17 @@ jobs:
- name: Get Tagged Version
id: lasttag
run: |
git config --global --add safe.directory "$PWD"
apt-get install -yqq jq
COMMIT="${{github.sha}}"
if ${{contains(github.head_ref, 'release/')}}; then
if ${{contains(github.head_ref, 'release')}}; then
V="${{github.head_ref}}"
V="${V#release/}"
else
V="$(cargo metadata --format-version=1 --no-deps | jq '.packages[0].version')"
V=v${V//\"/} #remove '"'s
echo "Extracted version: $V"
V="$(echo "v${V}" | sed 's/\"//g')"
echo "Cleaned up version: $V"
fi
# Check to see if the version tag already exists
Expand All @@ -353,6 +356,7 @@ jobs:
# 2) This is a feature branch being merged into the main branch.
if ${{(! github.event.pull_request.merged && contains(github.head_ref, 'release/')) || (github.event.pull_request.merged && !contains(github.head_ref, 'release/'))}}; then
V="${V}-$(git tag --list ${V}* | wc -l)"
echo "RC Version: $V"
fi
CL=${V#v}
Expand Down

0 comments on commit 41931a8

Please sign in to comment.