Set a git version number on most builds
If it isn't a release then it is some form of development build and should have a version that reflects that.
This commit is contained in:
parent
c2980d15e9
commit
99cf540e1a
|
@ -15,9 +15,7 @@ jobs:
|
||||||
GITREV=$(git rev-parse --short HEAD)
|
GITREV=$(git rev-parse --short HEAD)
|
||||||
echo $GITREV
|
echo $GITREV
|
||||||
sed -i "s/^\(.*\"version\".*\)\"\([^\"]\+\)\"\(.*\)\$/\1\"\2-g$GITREV\"\3/" package.json
|
sed -i "s/^\(.*\"version\".*\)\"\([^\"]\+\)\"\(.*\)\$/\1\"\2-g$GITREV\"\3/" package.json
|
||||||
if: |
|
if: github.event_name != 'release'
|
||||||
github.event_name == 'push' &&
|
|
||||||
github.event.ref == 'refs/heads/master'
|
|
||||||
- uses: actions/setup-node@v1
|
- uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
# Needs to be explicitly specified for auth to work
|
# Needs to be explicitly specified for auth to work
|
||||||
|
@ -56,9 +54,7 @@ jobs:
|
||||||
GITREV=$(git rev-parse --short HEAD)
|
GITREV=$(git rev-parse --short HEAD)
|
||||||
echo $GITREV
|
echo $GITREV
|
||||||
sed -i "s/^\(.*\"version\".*\)\"\([^\"]\+\)\"\(.*\)\$/\1\"\2-g$GITREV\"\3/" package.json
|
sed -i "s/^\(.*\"version\".*\)\"\([^\"]\+\)\"\(.*\)\$/\1\"\2-g$GITREV\"\3/" package.json
|
||||||
if: |
|
if: github.event_name != 'release'
|
||||||
github.event_name == 'push' &&
|
|
||||||
github.event.ref == 'refs/heads/master'
|
|
||||||
- run: |
|
- run: |
|
||||||
VERSION=$(grep '"version"' package.json | cut -d '"' -f 4)
|
VERSION=$(grep '"version"' package.json | cut -d '"' -f 4)
|
||||||
echo $VERSION
|
echo $VERSION
|
||||||
|
|
Loading…
Reference in New Issue