|
@@ -2,13 +2,16 @@
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
-version=$(jq -r .version package.json)
|
|
|
-release_name="typingfreaks-v$version"
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+if [[ "${GITHUB_REF:-}" == refs/tags/* ]]; then
|
|
|
+ version=${GITHUB_REF/refs\/tags\//}
|
|
|
+else
|
|
|
+ version="v$(jq -r .version package.json)"
|
|
|
+ if git ls-remote --tags --exit-code origin "$version"; then
|
|
|
+ echo "Release $release_name already exists"
|
|
|
+ exit 1
|
|
|
+ fi
|
|
|
+fi
|
|
|
+release_name="typingfreaks-$version"
|
|
|
|
|
|
npm run build
|
|
|
|
|
@@ -26,4 +29,4 @@ for file in $(git ls-files dist); do
|
|
|
done
|
|
|
zip -r "$release_name.zip" "$release_name"
|
|
|
|
|
|
-gh release create -d --notes "" "v$version" "$release_name.zip"
|
|
|
+gh release create -d --notes "" "$version" "$release_name.zip"
|