This repository has been archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change install version script and add check in release workflow to ch…
…eck version being published
- Loading branch information
1 parent
a963d7b
commit 561900c
Showing
3 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,11 @@ jobs: | |
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Check plugin and script version | ||
uses: mikefarah/[email protected] | ||
with: | ||
cmd: ./scripts/check_version.sh plugin.yaml scripts/install_version.sh ${{ github.ref }} | ||
- | ||
name: Set up Go | ||
uses: actions/setup-go@v2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/sh | ||
|
||
# Checks plugin.yaml version and also the install version script version | ||
|
||
set -e | ||
|
||
plugin_yaml=$1 | ||
# example: refs/tags/0.0.1 | ||
install_version_script=$2 | ||
refTag=$3 | ||
expected_version=$(echo $refTag | cut -d "/" -f 3) | ||
|
||
if [ -z $expected_version ]; | ||
then | ||
echo "git tag value is empty" | ||
exit 1 | ||
fi | ||
|
||
if [ ! -e $plugin_yaml ]; | ||
then | ||
echo "File $plugin_yaml does not exist!" | ||
exit 1 | ||
fi | ||
|
||
plugin_version=$(yq read $plugin_yaml version) | ||
|
||
if [ "$plugin_version" != "$expected_version" ]; | ||
then | ||
echo "Plugin version $plugin_version is not the expected version $expected_version" | ||
exit 1 | ||
fi | ||
|
||
if [ ! -e $install_version_script ]; | ||
then | ||
echo "File $install_version_script does not exist!" | ||
exit 1 | ||
fi | ||
|
||
set +e | ||
|
||
grep -q -F $expected_version $install_version_script | ||
wrong_version=$? | ||
|
||
set -e | ||
|
||
if [ $wrong_version != 0 ]; | ||
then | ||
echo "$install_version_script does not have the right version" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters