如何完成一次Apache的版本发布
理解Apache發布的內容和流程
總的來說,Source Release是Apache關注的重點,也是發布的必須內容;而Binary Release是可選項,Dubbo可以選擇是否發布二進制包到Apache倉庫或者發布到Maven中央倉庫。
請參考以下鏈接,找到更多關于ASF的發布指南:
- Apache Release Guide
- Apache Release Policy
- Maven Release Info
本地構建環境準備
主要包括簽名工具、Maven倉庫認證相關準備
安裝GPG,參見?https://www.gnupg.org/download/index.html
-
如Mac OS
$ brew install gpg $ gpg --version #檢查版本,應該為2.x
用gpg生成key
- 根據提示,生成key
-
查看key id
$ gpg --list-keys pub rsa4096/28681CB1 2018-04-26 # 28681CB1就是key id uid [ultimate] liujun (apache-dubbo) <liujun@apache.org> sub rsa4096/D3D6984B 2018-04-26# 通過key id發送public key到keyserver $ gpg --keyserver pgpkeys.mit.edu --send-key 28681CB1 # 其中,pgpkeys.mit.edu為隨意挑選的keyserver,keyserver列表為:https://sks-keyservers.net/status/,因為相互之間是自動同步的,選任意一個都可以。 -
如果有多個public key,設置默認key
~/.gnupg/gpg.conf
# If you have more than 1 secret key in your keyring, you may want to # uncomment the following option and set your preferred keyid.default-key 28681CB1
設置Apache中央倉庫
-
Dubbo項目的父pom為apache pom
<parent><groupId>org.apache</groupId><artifactId>apache</artifactId><version>19</version> </parent> -
添加以下內容到.m2/settings.xml
所有密碼請使用[maven-encryption-plugin](http://maven.apache.org/guides/mini/guide-encryption.html)加密后再填入
?
打包&上傳
首先,在2.6.4-release分支驗證maven組件打包、source源碼打包、簽名等是否都正常工作
$ mvn clean install -Papache-release $ mvn deploy # 將snapshot包推送到maven中央倉庫,處于staging狀態用maven-release-plugin發布
-
先用dryRun驗證是否ok
$ mvn release:prepare -Papache-release -Darguments="-DskipTests" -DautoVersionSubmodules=true -Dusername=YOUR GITHUB ID -DdryRun=true - 驗證通過后,執行release:prepare
-
執行release:perform,做正式發布
$ mvn -Prelease release:perform -Darguments="-DskipTests" -DautoVersionSubmodules=true -Dusername=YOUR GITHUB ID # 所有artifacts發布到配置的遠程maven中央倉庫,處于staging狀態
準備Apache發布
將dubbo checkout到本地目錄
$ svn checkout https://dist.apache.org/repos/dist/dev/incubator/dubbo # 假定本地目錄為 ~/apache/incubator/dubbo當前發布版本為2.6.4,新建目錄
$ cd ~/apache/incubator/dubbo # dubbo svn根目錄 $ mkdir 2.6.4生成sha512簽名
$ shasum -a 512 dubbo-incubating-2.6.4-source-release.zip >> dubbo-incubating-2.6.4-source-release.zip.sha512如果有binary release要同時發布
# 到dubbo項目distribution的module下,執行: $ mvn install # target目錄下,拷貝bin-release.zip以及bin-release.zip.asc到svn本地倉庫dubbo/2.6.4 # 參考第6步,生成sha512簽名提交到Apache svn
$ svn status $ svn commit -m 'prepare for 2.6.4 RC1'驗證Release Candidates
證環節包含但不限于以下內容和形式:
- Directory with?incubator?in name
? ? ?dubbo-incubating-${release_version}-bin-release - DISCLAIMER file exists
- LICENSE and NOTICE file exists and contents are good
- All files and no binary files exist
- All files has standard ASF License header
- Can compile from source
-
All unit tests can pass
mvn clean test # This will run all unit tests # you can also open rat and style plugin to check if every file meets requirements. mvn clean install -Drat.skip=false -Dcheckstyle.skip=false - Release candidates match with corresponding tags, you can find tag link and hash in vote email.
進入投票
投票分兩個階段:
郵件模板:
Hello Dubbo Community,This is a call for vote to release Apache Dubbo (Incubating) version 2.6.4.The release candidates: https://dist.apache.org/repos/dist/dev/incubator/dubbo/2.6.4/Git tag for the release: https://github.com/apache/incubator-dubbo/tree/dubbo-2.6.4Hash for the release tag: afab04c53edab38d52275d2a198ea1aff7a4f41eRelease Notes: https://github.com/apache/incubator-dubbo/releases/tag/untagged-4775c0a22c60fca55118The artifacts have been signed with Key : 28681CB1, which can be found in the keys file: https://dist.apache.org/repos/dist/dev/incubator/dubbo/KEYSThe vote will be open for at least 72 hours or until necessary number of votes are reached.Please vote accordingly:[ ] +1 approve [ ] +0 no opinion [ ] -1 disapprove with the reasonThanks, The Apache Dubbo (Incubating) Team正式發布
完成Maven Convenient Binary發布(可選)
apache.repository.org?nexus倉庫的權限已經申請,參見jira。
之前發布到maven倉庫的atifacts都處于staging狀態,用Apache?id登錄apache.repository.org,完成發布。
原文鏈接
本文為云棲社區原創內容,未經允許不得轉載。
總結
以上是生活随笔為你收集整理的如何完成一次Apache的版本发布的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 在 React 工程中利用 Mota 编
- 下一篇: 阿里云新推出 HiTSDB + IoT套