From the course: GitHub Actions for CI/CD: Build, Test, and Deploy

Unlock this course with a free trial

Join today to access over 25,600 courses taught by industry experts.

Build and publish a software package

Build and publish a software package

I'm in a new repo, and I've uploaded the exercise files for this lesson. The files set up a java project with the main file, a test suite, and a pom file that sets up a Maven configuration to test, build, and package the code. The configuration uses the GitHub runNumber environment variable to create a unique version for the artifact on each run. And the Distribution Management section of the document tells Maven to use GitHub Packages as the delivery location for the compiled artifact. I'll create the workflow from the Actions tab. Based on the repo contents, Actions suggests the workflow titled Publish Java Package with Maven. This is exactly the workflow I need, so I'll select that one. Alright, this workflow has everything we need to compile and publish a package. workflow uses a release trigger to kick things off. It's also requesting permissions to read the contents of the repo and write to the package registry. The write permission is key to running this workflow successfully…

Contents