Unpacking the possibilities of GitHub Packages

Publishing to GitHub Packages

Changes to build.gradle
gpr.user=[GITHUB_USERNAME]
gpr.key=[GITHUB_TOKEN]

Getting a GitHub token

Creating a GitHub token
./gradlew publish

Adding a GitHub Package as a dependency

<dependency>
<groupId>benjaminkomen</groupId>
<artifactId>jwiki</artifactId>
<version>${jwiki.version}</version>
</dependency>
<repositories>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/benjaminkomen/jwiki</url>
</repository>
</repositories>

Authenticating to GitHub Packages

subl ~/.m2/settings.xml
Environment variable in Travis CI
Changes to .travis.yml

The saga continues — Google Cloud

Using Cloud Key Management Service

gcloud kms keyrings create my-secrets --location global
gcloud kms keys create github-token --location global --keyring my-secrets --purpose encryption
gcloud kms keys list --location global --keyring my-secrets
echo "[GITHUB TOKEN]" > github_token.txt
gcloud kms encrypt \
--plaintext-file=github_token.txt \
--ciphertext-file=github_token.enc.txt \
--location=global \
--keyring=my-secrets \
--key=github-token
base64 github_token.enc.txt -w 0 > github_token.enc.64.txt
cat github_token.enc.64.txt

Configuring Cloud Build

Changes to cloudbuild.yml file
Changes to Dockerfiles

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store