Workflow Fix #6
@@ -19,38 +19,41 @@ jobs:
|
|||||||
- name: Variablen setzen
|
- name: Variablen setzen
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
echo "REPO=${{ gitea.repository }}" >> $GITHUB_ENV
|
echo "REPO=${{ gitea.repository }}" >> "$GITHUB_ENV"
|
||||||
echo "TAG=${{ gitea.ref_name }}" >> $GITHUB_ENV
|
echo "TAG=${{ gitea.ref_name }}" >> "$GITHUB_ENV"
|
||||||
echo "SERVER_URL=${{ gitea.server_url }}" >> $GITHUB_ENV
|
echo "SERVER_URL=https://git.local.unique-studios.de" >> "$GITHUB_ENV"
|
||||||
echo "API_BASE=${{ gitea.server_url }}/api/v1" >> $GITHUB_ENV
|
echo "API_BASE=https://git.local.unique-studios.de/api/v1" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Repo klonen
|
- name: Repo klonen
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
rm -rf /tmp/repo /tmp/build /tmp/release.json /tmp/assets.json
|
rm -rf /tmp/repo /tmp/build /tmp/release.json /tmp/assets.json
|
||||||
|
|
||||||
CLONE_URL="${SERVER_URL#https://}"
|
git clone "https://oauth2:${{ secrets.PAT_TOKEN }}@git.local.unique-studios.de/${REPO}.git" /tmp/repo
|
||||||
git clone "https://oauth2:${{ secrets.PAT_TOKEN }}@${CLONE_URL}/${REPO}.git" /tmp/repo
|
|
||||||
|
|
||||||
- name: ZIP mit Addon-Ordner bauen
|
- name: ZIP mit Addon-Ordner bauen
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
mkdir -p /tmp/build/HailMaryGuildTools
|
|
||||||
|
REPO_NAME="${REPO##*/}"
|
||||||
|
|
||||||
|
mkdir -p "/tmp/build/${REPO_NAME}"
|
||||||
|
|
||||||
rsync -a \
|
rsync -a \
|
||||||
--exclude='.git' \
|
--exclude='.git' \
|
||||||
--exclude='.gitea' \
|
--exclude='.gitea' \
|
||||||
/tmp/repo/ /tmp/build/HailMaryGuildTools/
|
/tmp/repo/ "/tmp/build/${REPO_NAME}/"
|
||||||
|
|
||||||
cd /tmp/build
|
cd /tmp/build
|
||||||
zip -r "/tmp/HailMaryGuildTools-${TAG}.zip" HailMaryGuildTools
|
zip -r "/tmp/${REPO_NAME}-${TAG}.zip" "${REPO_NAME}"
|
||||||
ls -lh "/tmp/HailMaryGuildTools-${TAG}.zip"
|
ls -lh "/tmp/${REPO_NAME}-${TAG}.zip"
|
||||||
|
|
||||||
- name: Release anlegen oder laden
|
- name: Release anlegen oder laden
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
API="${API_BASE}/repos/${REPO}"
|
API="${API_BASE}/repos/${REPO}"
|
||||||
|
REPO_NAME="${REPO##*/}"
|
||||||
|
|
||||||
echo "Server: ${SERVER_URL}"
|
echo "Server: ${SERVER_URL}"
|
||||||
echo "Repo: ${REPO}"
|
echo "Repo: ${REPO}"
|
||||||
@@ -72,7 +75,7 @@ jobs:
|
|||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{
|
-d "{
|
||||||
\"tag_name\": \"${TAG}\",
|
\"tag_name\": \"${TAG}\",
|
||||||
\"name\": \"${REPO##*/} ${TAG}\",
|
\"name\": \"${REPO_NAME} ${TAG}\",
|
||||||
\"draft\": false,
|
\"draft\": false,
|
||||||
\"prerelease\": false
|
\"prerelease\": false
|
||||||
}" \
|
}" \
|
||||||
@@ -91,7 +94,8 @@ jobs:
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
RELEASE_ID=$(jq -r '.id' /tmp/release.json)
|
RELEASE_ID=$(jq -r '.id' /tmp/release.json)
|
||||||
FILE_NAME="HailMaryGuildTools-${TAG}.zip"
|
REPO_NAME="${REPO##*/}"
|
||||||
|
FILE_NAME="${REPO_NAME}-${TAG}.zip"
|
||||||
ASSET_API="${API_BASE}/repos/${REPO}/releases/${RELEASE_ID}/assets"
|
ASSET_API="${API_BASE}/repos/${REPO}/releases/${RELEASE_ID}/assets"
|
||||||
|
|
||||||
curl --fail -s \
|
curl --fail -s \
|
||||||
@@ -117,7 +121,8 @@ jobs:
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
RELEASE_ID=$(jq -r '.id' /tmp/release.json)
|
RELEASE_ID=$(jq -r '.id' /tmp/release.json)
|
||||||
FILE="/tmp/HailMaryGuildTools-${TAG}.zip"
|
REPO_NAME="${REPO##*/}"
|
||||||
|
FILE="/tmp/${REPO_NAME}-${TAG}.zip"
|
||||||
FILE_NAME="$(basename "$FILE")"
|
FILE_NAME="$(basename "$FILE")"
|
||||||
UPLOAD_URL="${API_BASE}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=${FILE_NAME}"
|
UPLOAD_URL="${API_BASE}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=${FILE_NAME}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user