Clean up push-banks.yml
This commit is contained in:
@@ -9,15 +9,21 @@ jobs:
|
||||
runs-on: linux-mint
|
||||
env:
|
||||
UNITY_SSH_KEY: ${{ secrets.TESTFMODPIPELINE }}
|
||||
GITEA_SSH_PORT: "222"
|
||||
GITEA_HOST_URL: "git.hbrsgamedev.team"
|
||||
GITEA_SSH_PORT: "222"
|
||||
TARGET_REPO: "sdaehn2s/Team-A-dream-traveler-unity-test.git"
|
||||
ARTIFACT_NAME: "fmod-banks"
|
||||
DOWNLOAD_DIR: "./downloaded-banks"
|
||||
TARGET_DIR: "Assets/StreamingAssets/FMOD"
|
||||
BRANCH_PREFIX: "fmod/banks"
|
||||
BOT_NAME: "fmod-pipeline-bot"
|
||||
BOT_EMAIL: "fmod-bot@h-brs.local"
|
||||
steps:
|
||||
- name: Download Built Banks
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: fmod-banks
|
||||
path: ./downloaded-banks
|
||||
name: ${{ env.ARTIFACT_NAME }}
|
||||
path: ${{ env.DOWNLOAD_DIR }}
|
||||
|
||||
- name: Clone, Update Banks and Push Branch
|
||||
run: |
|
||||
@@ -30,27 +36,25 @@ jobs:
|
||||
ssh-keyscan -H "$GITEA_HOST_URL" -p "$GITEA_SSH_PORT" >> ~/.ssh/known_hosts
|
||||
|
||||
export GIT_SSH_COMMAND="ssh -i ~/.ssh/id_fmod -o IdentitiesOnly=yes"
|
||||
|
||||
SSH_URL="ssh://git@${GITEA_HOST_URL}:${GITEA_SSH_PORT}/${TARGET_REPO}"
|
||||
|
||||
rm -rf ./unity-repo
|
||||
git clone "$SSH_URL" ./unity-repo
|
||||
cd ./unity-repo
|
||||
|
||||
git config user.name "fmod-pipeline-bot"
|
||||
git config user.email "fmod-bot@h-brs.local"
|
||||
git config user.name "$BOT_NAME"
|
||||
git config user.email "$BOT_EMAIL"
|
||||
|
||||
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
|
||||
BRANCH_NAME="fmod/banks-${{ github.run_number }}-${SHORT_SHA}"
|
||||
BRANCH_NAME="${BRANCH_PREFIX}-${{ github.run_number }}-${SHORT_SHA}"
|
||||
git checkout -b "$BRANCH_NAME"
|
||||
|
||||
TARGET_DIR="Assets/StreamingAssets/FMOD"
|
||||
mkdir -p "$TARGET_DIR"
|
||||
cp -r ../downloaded-banks/* "$TARGET_DIR/"
|
||||
cp -r "../${DOWNLOAD_DIR#./}/"* "$TARGET_DIR/"
|
||||
|
||||
git add "$TARGET_DIR"
|
||||
if git diff --cached --quiet; then
|
||||
echo "Keine Änderungen an den .bank-Dateien – kein Commit nötig."
|
||||
echo "No changes on the .bank files. No commit necessary."
|
||||
else
|
||||
git commit -m "chore(fmod): update banks from run #${{ github.run_number }} (${SHORT_SHA})"
|
||||
git push -u origin "$BRANCH_NAME"
|
||||
|
||||
Reference in New Issue
Block a user