forked from klenin/Yuzu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
23 lines (22 loc) · 1.13 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
variables:
GIT_STRATEGY: fetch
push_to_github:
stage: build
except:
- /^UWP.*/
tags:
- win
script:
# replace backslashes with forwards slashes in a path to private key
- $env:GAME_FOREST_BOT_RSA=$env:GAME_FOREST_BOT_RSA -replace "[\\]", "/"
# replace crlf in last line of private key, because gitlab is broken (and -NoNewLine option because powershell is also broken)
- ((Get-Content $env:GAME_FOREST_BOT_RSA) -join "`n") + "`n" | Set-Content -NoNewline $env:GAME_FOREST_BOT_RSA
# override ssh command for git to ignore remote host fingerprint and provide custom private key
- $env:GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -i $env:GAME_FOREST_BOT_RSA -F /dev/null"
- git config user.email [email protected]
- git config --replace-all user.name "Game Forest"
- git remote add github [email protected]:game-forest/Yuzu.git; if ($?) { } else { echo "remote already set" }
- git fetch github
- git branch -D $env:CI_BUILD_REF_NAME; if ($?) { } else { echo "branch doesn't exist" }
- git checkout --track origin/$env:CI_BUILD_REF_NAME
- git push --force github $env:CI_BUILD_REF_NAME