phly / keep-a-changelog

Tools for manipulating CHANGELOG.md files in Keep A Changelog format, including tagging and releasing.
https://phly.github.io/keep-a-changelog/
BSD 2-Clause "Simplified" License
181 stars 21 forks source link

Add automated and manual PHAR-creation #67

Closed heiglandreas closed 4 years ago

heiglandreas commented 4 years ago

The PHAR file will be created using humbug/box. It will be scoped, so that it will not interfere with any other autoloading code.

The code in the .travis.yml-file will cause the PHAR file to be created automatically by the CI-System everytime a new tag is created. The resulting PHAR file will then be uploaded as build-artifact and can then be downloaded from the Release-page.

This requires the GITHUB_API_KEY to be set! This has to be done by the maintainer!

The PHAR will be created using PHP7.2

heiglandreas commented 4 years ago

The github action requires an encrypted GPG-Key-pair to be added to the repository as well as the decryption password and the password to the private key be added to the repos secrets. Additionally the key-ID needs to be replaced in the workflow-file.

Currently the key is a key especially created for signing these build-artifacts but it is clearly marked as a test-key.

The key can be created as follows:

# The password you supply here for the private key is the "SIGN_KEY"
gpg --full-gen-key
export KEY_ID=[KEY-ID]
gpg --keyserver keys.openpgp.org --send-key $KEY_ID
gpg --export -a $KEY_ID > keys.asc
gpg --export-secret-key -a $KEY_ID >> keys.asc
# The password you will provide here is the "DECRYPT_KEY"
gpg -c keys.asc
mv keys.asc.gpg KeepAChangelogSigning.asc.gpg
git add KeepAChangelogSigning.asc.gpg
rm keys.asc
sed -i "" "s/5A30219F03D3A2A5/$KEY_ID/" .github/workflows/buildAndDeployPhar.yml
git add .github/workflows/buildAndDeployPhar.yml

Then the SIGN_KEY and the DECRYPT_KEY need to be added to https://github.com/phly/keep-a-changelog/settings/secrets with the corresponding values.

weierophinney commented 4 years ago

I'm about to merge this - but one question: would this be setup in such a way that we could add a self-update feature later?

heiglandreas commented 4 years ago

@weierophinney jepp. There's one line commented out. when that is again commented in the automated deployment should work out of the box

weierophinney commented 4 years ago

Aannndddd: first release! https://github.com/phly/keep-a-changelog/releases/tag/2.3.0