These are different protocols and they serve different purposes.
TLS is an online protocol between two different parties. It's designed to ensure the security of a connection between two endpoints of a connection. The connection is ephemeral and both parties must be online at the same moment with sufficient bandwidth.
OpenPGP is an offline protocol. It can be used to encrypt data between two parties who may never be online at the same time. More commonly, it is used to sign data for software distribution (or other uses) by one party which is then received by other parties and verified at a later time.
If you want to use the X.509 keys and certificates that are used for TLS, you can use CMS, which is also an offline protocol. It is substantially less popular in the open source community because typically the certificates required have a shorter timeframe and they often cost money, leading to decreased adoption.
In many cases, the answer is that both are a good idea. Generally, you should serve all HTTP connections over TLS these days, and if you are distributing software, you probably will want to use some sort of digital signature to verify its integrity. TLS is important to prevent revealing the data that is transferred in case it is sensitive (for legal reasons or otherwise) and a digital signature (e.g., via OpenPGP) means that an attacker who can compromise the storage of the remote server cannot distribute modified software, provided the key is stored elsewhere.