问题描述
Azure DevOps中的生成定义生成一个.ipa文件(iOS应用程序文件).我想将由Azure DevOps构建生成的.ipa文件直接推送到远程GitHub存储库中.
不推荐,将生成的输出添加到Source Control中.如果有特殊原因,可以在
如果您想要的是在一个地方长时间存储文件.考虑使用 Azure Artifacts ,可以使用通用软件包来托管文件.在本地计算机或云构建管道中的提要中发布/下载软件包很方便.
希望以上各项对您有所帮助,如果我误解了任何内容,请随时告诉我:)
A build definition in Azure DevOps generates a .ipa file(iOS app file). I want to push this .ipa file generated by Azure DevOps build, directly into a remote GitHub Repository.
It's not recommended to add build output into Source Control. If you have special reason to do this, you can run git commands in Command-line task or Powershell Task to do the commit and push.
My steps to get it work(I use Microsoft windows-hosted agent with one public github repos):
1.Check the log of build task to get the path of Test.txt file
2.Add one Command-Line task after last build task with content similar to this:
git clone https://github.com/xxx/TestUpload.git
git config --global user.email [email protected]
git config --global user.name xxx
copy "D:\a\1\s\xxx\Test.txt" TestUpload
cd TestUpload
git add .
git commit -m "Do sth."
git push https://UserName:[email protected]/xxx/TestUpload.git master
For more details about git push you can check this. And since I run the pipeline in windows-hosted agent, so I need to git clone
the remote repos first.
Also, I'm not sure if you're running that in Mac OS agent, if so, the command-line task is still available for you. But you may need to replace the copy xxx
and cd xxx
in script with bash syntax in MacOS.
Other directions:
If what you actually need is to download the output xx.ipa file. Consider using Publish Build Artifacts task, you can use this task to copy the build output and zip that into one xx.zip file. After the build pipeline succeeds, you can download it from Summary:
If what you want is to have one place to store your file for a long time. Consider using Azure Artifacts, you can use Universal Package to host the file. It's convenient to publish/download the package to/from feed in local machine or in cloud build pipeline.
Hope all above helps and if I misunderstand anything, feel free to let me know it:)
这篇关于通过Azure DevOps将文件提交到远程github存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!