Skip to content

Commit a345548

Browse files
committed
[skip ci] move whitespace removal into VERSION action
1 parent 2875318 commit a345548

File tree

2 files changed

+27
-32
lines changed

2 files changed

+27
-32
lines changed

.github/actions/version/action.yml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@ outputs:
1010
runs:
1111
using: "composite"
1212
steps:
13-
- name: get interpreter
14-
shell: bash
15-
id: get-interpreter
16-
run: |
17-
if [[ $RUNNER_OS == 'macOS' ]]; then
18-
interpreter='zsh {0}'
19-
else
20-
interpreter=bash
21-
fi
22-
echo "interpreter=$interpreter" >> "$GITHUB_OUTPUT"
13+
- name: get interpreter
14+
shell: bash
15+
id: get-interpreter
16+
run: |
17+
if [[ $RUNNER_OS == 'macOS' ]]; then
18+
interpreter='zsh {0}'
19+
else
20+
interpreter=bash
21+
fi
22+
echo "interpreter=$interpreter" >> "$GITHUB_OUTPUT"
2323
24-
- name: Get version
25-
shell: ${{ steps.get-interpreter.outputs.interpreter }}
26-
id: get-version
27-
env:
28-
RELEASE_TAG: ${{ github.event.release.tag_name }}
29-
run: |
30-
# get the Build Bumber & version from git
31-
VERSION="$(cat VERSION)"
32-
BUILD_NUMBER="$(git rev-list HEAD --count)"
33-
# Gets the release tag from github if it exists (Github Actions)
34-
# Assumes tags start with V
35-
if [[ -v RELEASE_TAG ]] && [[ -n $RELEASE_TAG ]]; then
36-
TAG="${RELEASE_TAG,,}"
37-
VERSION="${TAG//"v"}"
38-
fi
39-
echo "BUILD_NUMBER=$BUILD_NUMBER" >> "$GITHUB_OUTPUT"
40-
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
24+
- name: Get version
25+
shell: ${{ steps.get-interpreter.outputs.interpreter }}
26+
id: get-version
27+
env:
28+
RELEASE_TAG: ${{ github.event.release.tag_name }}
29+
run: |
30+
# get the Build Bumber & version from git
31+
VERSION="$(cat VERSION | egrep -o '[0-9.]+')"
32+
BUILD_NUMBER="$(git rev-list HEAD --count)"
33+
# Gets the release tag from github if it exists (Github Actions)
34+
# Assumes tags start with V
35+
if [[ -v RELEASE_TAG ]] && [[ -n $RELEASE_TAG ]]; then
36+
TAG="${RELEASE_TAG,,}"
37+
VERSION="${TAG//"v"}"
38+
fi
39+
echo "BUILD_NUMBER=$BUILD_NUMBER" >> "$GITHUB_OUTPUT"
40+
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"

.github/workflows/release.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,6 @@ jobs:
8080
# Split version into array
8181
readarray -d "." -t versionSplit <<< "$version"
8282
83-
# Remove non numeric characters
84-
for i in "${!versionSplit[@]}"; do
85-
versionSplit[i]=`echo "$versionSplit[i]" | egrep -o '[0-9.]+'`
86-
done
87-
8883
major=${versionSplit[0]}
8984
minor=${versionSplit[1]}
9085
patch=${versionSplit[2]}

0 commit comments

Comments
 (0)