Add workaround to get tagged version in GitHub workflow script
This commit is contained in:
11
.github/workflows/jar.yaml
vendored
11
.github/workflows/jar.yaml
vendored
@@ -15,6 +15,13 @@ jobs:
|
|||||||
- name: Install JDK
|
- name: Install JDK
|
||||||
run: sudo apt install default-jdk
|
run: sudo apt install default-jdk
|
||||||
|
|
||||||
- name: Build
|
- name: Set env
|
||||||
run: ./build.sh host-jar "release"
|
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: PKG_VER_TAG=$RELEASE_VERSION ./build.sh host-jar "release"
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
path: dist
|
||||||
|
|
||||||
|
|||||||
5
build.sh
5
build.sh
@@ -504,7 +504,10 @@ host-jar()
|
|||||||
cd $JAVA_JAR_DIR
|
cd $JAVA_JAR_DIR
|
||||||
export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
|
export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
|
||||||
javac -Xlint:deprecation com/zerotier/sockets/*.java
|
javac -Xlint:deprecation com/zerotier/sockets/*.java
|
||||||
jar cf libzt-"$(git describe --abbrev=0)".jar $SHARED_LIB_NAME com/zerotier/sockets/*.class
|
|
||||||
|
PKG_VER_TAG="${PKG_VER_TAG:-"$(git describe --abbrev=0)"}"
|
||||||
|
|
||||||
|
jar cf libzt-$PKG_VER_TAG.jar $SHARED_LIB_NAME com/zerotier/sockets/*.class
|
||||||
rm -rf com $SHARED_LIB_NAME
|
rm -rf com $SHARED_LIB_NAME
|
||||||
cd -
|
cd -
|
||||||
# Copy JAR to dist/
|
# Copy JAR to dist/
|
||||||
|
|||||||
Reference in New Issue
Block a user