Code Monkey home page Code Monkey logo

github-actions-practice's Introduction

GitHub Actions Practice

Practice repository for automating NuGet Package publishing via GitHub Actions.

Publishing NuGet Package

  • When a commit containing changes to the ExampleClassLibrary project is pushed to the main branch, the Publish NuGet Package workflow will automatically build and publish a prerelease NuGet package for it.
  • When a Release is published, the workflow will trigger and publish a release version of the NuGet package, and attach a build of the .nupkg and ExampleConsoleApp to the release.

Versioning

  • The package's version string is automatically generated using the latest tag via MinVer, referenced in the ExampleClassLibrary project.
  • Commits pushed to main will have its package version suffixed with -prerelease.x, where x is the prerelease build iteration.
  • Publishing a new release will trigger a NuGet Package publish as a release version.

Creating a Release package

  • Create a new release via this link and create a new version tag following the semantic versioning scheme (for example: "0.1.0").
  • The Publish NuGet Package workflow will trigger when the release is published and will generate a release version of the package.
  • The Attach Example App To Release workflow will build the ExampleConsoleApp project and upload the artifacts to the release page.

GitHub Action Workflow

See the Publish NuGet Package workflow for reference.

At a high-level the workflow:

  • Checks out the repo
  • Sets up .NET 6
  • Builds the ExampleClassLibrary project
  • Builds the NuGet package using the project's build output
  • Publishes the NuGet package

Variables & Secrets

Variables & secrets accessible to the workflow can be configured here.

Testing GitHub Actions locally

To easily test Github Actions locally, you can use act.

Once act is setup in your environment, you can run act at the root of the repo. This will run the workflows in a Docker container on your machine, providing the benefit of a quicker feedback loop as you develop workflows.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.