- Hands-On Full:Stack Development with Swift
- Ankur Patel
- 210字
- 2021-08-27 19:39:43
Publishing a Swift package
Publishing a Swift package is as simple as committing code, tagging it, and pushing it up to a git repository. To publish the package, perform the following steps:
- Create a public git repository on github.com.
- Open the Terminal and change your directory to your package's path, cd /path/to/your/swift/package. Then initialize the git repository by running the git init command.
- Add a remote origin to the local git repo by running this command:
git remote add origin git@github.com:<repoaccount>/<reponame>.git
- Make sure to replace the repo account and repo name with the one you created in Step 1.
- Add all files to this repo using git add . and commit them using git commit -m "Initial Commit".
- Tag it with a version. Since it is our first package we will tag it 1.0.0,
git tag 1.0.0. - Publish it by pushing it up to the repo along with the tag:
git push origin master --tags
It is that easy to make a Swift package and publish it. All you need is a git repository to push your code to and tag your code appropriately so that whoever uses your package as a dependency can point to a specific version.
推薦閱讀
- Cisco OSPF命令與配置手冊(cè)
- Modern JavaScript Web Development Cookbook
- 工業(yè)控制網(wǎng)絡(luò)安全技術(shù)與實(shí)踐
- 信息通信網(wǎng)絡(luò)建設(shè)安全管理概要2
- 正在爆發(fā)的互聯(lián)網(wǎng)革命
- 物聯(lián)網(wǎng)時(shí)代
- 物聯(lián)網(wǎng)之霧:基于霧計(jì)算的智能硬件快速反應(yīng)與安全控制
- C/C++串口通信:典型應(yīng)用實(shí)例編程實(shí)踐
- jQuery Mobile Web Development Essentials
- 夢(mèng)工廠之材質(zhì)N次方:Maya材質(zhì)手冊(cè)
- React Cookbook
- 物聯(lián)網(wǎng)頂層設(shè)計(jì)與關(guān)鍵技術(shù)
- LwIP應(yīng)用開(kāi)發(fā)實(shí)戰(zhàn)指南:基于STM32
- Enterprise ApplicationDevelopment with Ext JSand Spring
- 加密與解密實(shí)戰(zhàn)全攻略