only upload the correct jar file
This commit is contained in:
@@ -77,14 +77,20 @@ jobs:
|
||||
- name: Install jq
|
||||
run: apt-get update && apt-get install -y jq
|
||||
|
||||
- name: Read mod info again
|
||||
- name: Read mod info from gradle.properties
|
||||
id: mod_info
|
||||
run: |
|
||||
NAME=$(grep "^archives_base_name" gradle.properties | cut -d'=' -f2)
|
||||
VERSION=$(grep "^mod_version" gradle.properties | cut -d'=' -f2)
|
||||
|
||||
if [ -z "$NAME" ] || [ -z "$VERSION" ]; then
|
||||
echo "Failed to read mod info"
|
||||
exit 1
|
||||
fi
|
||||
JAR="build/libs/${NAME}-${VERSION}.jar"
|
||||
echo "NAME=$NAME" >> $GITEA_ENV
|
||||
echo "VERSION=$VERSION" >> $GITEA_ENV
|
||||
|
||||
echo "JAR=$JAR" >> $GITEA_ENV
|
||||
- name: Determine tag
|
||||
run: |
|
||||
BASE="${NAME}-${VERSION}"
|
||||
@@ -123,12 +129,15 @@ jobs:
|
||||
|
||||
echo "RELEASE_ID=$RELEASE_ID" >> $GITEA_ENV
|
||||
|
||||
- name: Upload jar to release
|
||||
- name: Upload the mod JAR
|
||||
run: |
|
||||
FILE=$(ls ./release-artifacts/*.jar | head -n 1)
|
||||
if [ ! -f "$JAR" ]; then
|
||||
echo "Error: JAR not found: $JAR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
curl -X POST \
|
||||
-H "Authorization: token ${{ secrets.GITEATOKEN }}" \
|
||||
-H "Content-Type: application/java-archive" \
|
||||
--data-binary @"$FILE" \
|
||||
"${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/releases/${RELEASE_ID}/assets?name=$(basename $FILE)"
|
||||
--data-binary @"$JAR" \
|
||||
"${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/releases/${RELEASE_ID}/assets?name=$(basename $JAR)"
|
||||
Reference in New Issue
Block a user