Change how build script reads version tag

This commit is contained in:
Joseph Henry
2021-05-18 23:38:52 -07:00
parent a56ca93f54
commit f5c9450d0c
3 changed files with 10 additions and 7 deletions

View File

@@ -15,11 +15,8 @@ jobs:
- name: Install JDK
run: sudo apt install default-jdk
- name: Set env
run: echo "RELEASE_VERSION=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV
- name: Build
run: PKG_VER_TAG=$RELEASE_VERSION ./build.sh host-jar "release"
run: ./build.sh host-jar "release"
- uses: actions/upload-artifact@v2
with:

1
.version Normal file
View File

@@ -0,0 +1 @@
1.4.1

View File

@@ -505,9 +505,7 @@ host-jar()
export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
javac -Xlint:deprecation com/zerotier/sockets/*.java
PKG_VER_TAG="${PKG_VER_TAG:-"$(git describe --abbrev=0)"}"
jar cf libzt-$PKG_VER_TAG.jar $SHARED_LIB_NAME com/zerotier/sockets/*.class
jar cf libzt-"$(cat .version)".jar $SHARED_LIB_NAME com/zerotier/sockets/*.class
rm -rf com $SHARED_LIB_NAME
cd -
# Copy JAR to dist/
@@ -726,6 +724,13 @@ clean()
cd pkg/pypi && ./build.sh clean
}
tag_release()
{
git tag -a $1 -m $2
"$(git describe --tags --abbrev=0)" >> .version
git push origin --tags
}
list()
{
IFS=$'\n'