Skip to content

Commit cd01f8e

Browse files
authored
Update publish.yml
1 parent b6160e2 commit cd01f8e

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

.github/workflows/publish.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99
options:
1010
- PATCH
1111
- MINOR
12-
- MAJOR
1312

1413
permissions:
1514
contents: write
@@ -31,12 +30,6 @@ jobs:
3130
MINOR=$(cat $VERSION_FILE | grep "const MINOR" | sed -e 's/^.*\ \(=\ \)*\(\"\)*\([0-9]*\)\(\"\)*.*/\3/g');
3231
PATCH=$(cat $VERSION_FILE | grep "const PATCH" | sed -e 's/^.*\ \(=\ \)*\(\"\)*\([0-9]*\)\(\"\)*.*/\3/g');
3332
LAST_TAG="v$MAJOR.$MINOR.$PATCH";
34-
if [ "$VERSION_CHANGE" = "MAJOR" ]
35-
then
36-
MAJOR=$((MAJOR+1));
37-
MINOR=0;
38-
PATCH=0;
39-
fi;
4033
if [ "$VERSION_CHANGE" = "MINOR" ]
4134
then
4235
MINOR=$((MINOR+1));
@@ -46,9 +39,12 @@ jobs:
4639
then
4740
PATCH=$((PATCH+1));
4841
fi;
49-
sed -e 's/const MAJOR = "\([0-9]*\)"/const MAJOR = "'$MAJOR'"/g' -i $VERSION_FILE;
50-
sed -e 's/const MINOR = "\([0-9]*\)"/const MINOR = "'$MINOR'"/g' -i $VERSION_FILE;
51-
sed -e 's/const PATCH = "\([0-9]*\)"/const PATCH = "'$PATCH'"/g' -i $VERSION_FILE;
42+
echo "<?php
43+
const MAJOR = "$MAJOR";
44+
const MINOR = "$MINOR";
45+
const PATCH = "$PATCH";
46+
" >> $VERSION_FILE.tmp
47+
mv $VERSION_FILE.tmp $VERSION_FILE;
5248
git add $VERSION_FILE;
5349
echo "## $MAJOR.$MINOR.$PATCH" >> $CHANGELOG_FILE.tmp
5450
cat $CHANGELOG_FILE >> $CHANGELOG_FILE.tmp

0 commit comments

Comments
 (0)