Creating a Release with GitHub Actions

45 minutes
  • 3 Learning Objectives

About this Hands-on Lab

Your team has set up an automated build process for your application code. You want to store this artifact so other teams can access it for downstream work. You will need to build out the workflow file to leverage GitHub Packages to store new versions of your code with each new build.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Set up a GitHub Repository
  1. Fork the repo https://github.com/linuxacademy/content-github-actions-deep-dive-lesson.
  2. Check out the lab branch and confirm /github/workflows/deploy-pipeline.yaml contains lint and build jobs.

    Note: You can clone the repo locally or work in the GitHub browser.

    If you have trouble, the complete code for one possible solution is on the lab-package-solution.

Create a Release
  1. Create a publish job.
  2. Add a step to create a release and commit the changes.
  3. Check the release in the GitHub console. It has the complete codebase, but not the build artifact with the dependencies.
Add a Release Asset
  1. Set the publish job to run after the build job.
  2. Add a step to the publish job to upload the build artifact as a part of the release and commit the changes.

    Note: The new release will contain a zipped bundle with all the libraries.

Additional Resources

Scenario

Your team has set up an automated build process for your application code. You want to store this artifact so other teams can access it for downstream work. You will need to build out the workflow file to leverage GitHub Packages to store new versions of your code with each new build.

Objectives

  1. Set up a GitHub repository.
  2. Create a release.
  3. Add a release asset.

    Links and Resources:

    • GitHub repository: https://github.com/linuxacademy/content-github-actions-deep-dive-lesson
  • GitHub Actions Checkout community action: https://github.com/marketplace/actions/checkout

  • Upload/download artifacts: https://docs.github.com/en/actions/guides/storing-workflow-data-as-artifacts

  • Using needs: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idneeds

  • Step ids: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs

  • Git tags: https://git-scm.com/book/en/v2/Git-Basics-Tagging

  • GitHub releases: https://docs.github.com/en/github/administering-a-repository/releasing-projects-on-github/managing-releases-in-a-repository

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?