Giter Club home page Giter Club logo

assemblyinfo-update's Introduction

AssemblyInfo Update

set-version

This Github action updates AssemblyInfo.cs files in .NET projects with the specified version number by default suffixed with github.run_number.

The version number is expected to be in SemVer format with at least the major and minor version numbers, e.g. 1.20, 2.17.4, 1.4.9-alpha. Any pre-release/metadata suffix will be discarded and github.run_number appended to produce a 3- or 4-element version number.

Note that any existing value in the file is overwritten, so may be left at, say, "0.0.0.0". The updated file is not committed back to the repository.

This action is useful for automatically updating the assembly info version of a project prior to building it, for example, where the version number should be set to the latest tag.

Input arguments

  • version (required): The assembly version in semver format
  • directory: the directory where the assembly info file is located (or the top-most directory to search if recursive is true). Defaults to '.\'
  • filename: the file name of the assembly info file. Defaults to 'AssemblyInfo.cs'
  • recursive: if true, updates all assembly info files matching the filename argument, in all subdirectories. Defaults to true
  • usebuildnumber: if true adds build number to the provided version. Default to true
  • failifnomatchfound : If true fails if no matching files are found. Default to false

Output arguments

  • version: the value of the version used in the assembly info

Example Usage

Minimal example

- name: Set version in all AssemblyInfo.cs files
  uses: secondbounce/assemblyinfo-update@v2
  with:
    version: '1.0.8'

Complete example

- name: Set version in .\Properties\SharedAssemblyInfo.cs
  id: set-assembly-version
  uses: secondbounce/assemblyinfo-update@v2
  with:
    version: '2.1.16-alpha'
    directory: '.\Properties'
    filename: 'SharedAssemblyInfo.cs'
    recursive: false

- name: Display the version used
  run: echo "{{steps.set-assembly-version.outputs.version}}"

Development Testing

This repo includes a test workflow - .github/workflows/test-actions.yml - that is configured to run on each commit to the develop (and main) branch. This workflow runs the latest code as a test, saving the updated sample files as artifacts, should the output need to be checked.

assemblyinfo-update's People

Contributors

thampton avatar davidgeary avatar

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.