[Gitlab Runner] Copying a file through bash script deletes the source file

Hi, I am using shell executor in gitlab-runner I have this bash script that will copy my built file to a folder, but it fails. When I inspected, I saw that it removes my source file.

I tried building my file and running the bash script manually, it successfully copied the file.

Any suggestions?

Here’s my script:

buildnumber=$(date +%s)
mkdir -p "/home/vmserver/social-game/releases/$version"
cp -a main "/home/vmserver/social-game/releases/$version"

The “main” is my built file.