-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
66 additions
and
7 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 |
---|---|---|
|
@@ -57,10 +57,3 @@ jobs: | |
- name: set release version | ||
run: | | ||
echo '${{ github.ref_name }}' > tag | ||
- name: Push files | ||
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git add tag | ||
git commit -m "[Automatic] bumpup version to ${{ github.ref_name }}" | ||
git push |
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,66 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
extensionPath="$(dirname "$0")" | ||
|
||
tag=v0.1.7 | ||
imagename="gh-echo" | ||
repo="DarkWeird/gh-echojava" | ||
arch="$(uname -m)" | ||
|
||
exe="" | ||
|
||
# resolve exe name for fetch release from GitHub releases. | ||
if uname -a | grep Msys > /dev/null; then | ||
if [ $arch = "x86_64" ]; then | ||
exe="${imagename}-Windows.exe" | ||
fi | ||
elif uname -a | grep Darwin > /dev/null; then | ||
if [ $arch = "x86_64" ]; then | ||
exe="${imagename}-macOS" | ||
fi | ||
elif uname -a | grep Linux > /dev/null; then | ||
if [ $arch = "x86_64" ]; then | ||
exe="${imagename}-Linux" | ||
fi | ||
fi | ||
|
||
executablePath = ""; | ||
|
||
if [ "${exe}" == "" ]; then | ||
if uname -a | grep Msys >/dev/null; then | ||
imagename = "${imagename}.exe" | ||
fi | ||
if [[ -x "${extensionPath}/build/libs/gh-echo-0.1-all.jar"]]; then | ||
# JVM variant | ||
executablePath = "${extensionPath}/build/libs/gh-echo-0.1-all.jar" | ||
elif [[ -x "${extensionPath}/build/native/nativeCompile/${imagename}"]]; then | ||
# Native Image variant | ||
executablePath = "${extensionPath}/build/native/nativeCompile/${imagename}" | ||
else | ||
if [ ! "$(which javac)" = "" ]; then | ||
if [ ! "$(which native-image)" = ""]; then | ||
./gradlew nativeCompile | ||
executablePath = "${extensionPath}/build/native/nativeCompile/${imagename}" | ||
else | ||
./gradlew shadowJar | ||
executablePath = "${extensionPath}/build/libs/gh-echo-0.1-all.jar" | ||
fi | ||
else | ||
echo "You haven't java for building this project" | ||
exit 1; | ||
fi | ||
fi | ||
|
||
else | ||
executablePath = "${extensionPath}/${exe}" | ||
# Check release executable | ||
if [[ ! -x "${executablePath}" ]]; then | ||
#Fetch release | ||
gh release -R"${repo}" download "${tag}" -p "${exe}" --dir "${extensionPath}" | ||
e | ||
chmod +x "${executablePath}" | ||
fi | ||
fi | ||
|
||
exec "${extensionPath}/${exe}" "$@" |