Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
edit-3

GitHub Action

Version Patcher

v0.2

Version Patcher

edit-3

Version Patcher

Patches the versions on C# (csproj VS2017+), npm (package.json), Python (setup.py) and other files

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Version Patcher

uses: justalemon/[email protected]

Learn more about this action in justalemon/VersionPatcher

Choose a version

VersionPatcher
GitHub Actions Patreon PayPal Discord

Please note that the Action is currently in Beta and is my first project in JS, so some bugs might be present. Feel free to open an issue if you find any.

VersionPatcher is a simple GitHub Action that helps you patch the version of your projects before compiling your code. It can be considered a replacement for AppVeyor's AssemblyInfo and NET .csproj patching for people moving from AppVeyor to GitHub Actions.

It supports the following project types:

Programming Language Project File Compiler or Manager Remarks
C# *.csproj msbuild/dotnet VS 2017 and up only
JavaScript/TypeScript package.json npm
Python setup.py build/setuptools
Python __init__.py PEP440
Lua fxmanifest.lua cfx.re For FiveM, RedM and LibertyM

Please note that you need to have an existing dummy version for the script to pick detect.

Installation

To add the action to your workflow, you just add it as step in a job. This is an example of what it should look like:

      - name: Patch Versions
        uses: justalemon/VersionPatcher@master
        with:
          version: 1.0.0.${{ github.run_number }}

You will need to specify a glob to patch a specific type of version in a specific project. See below for more information.

Usage

There are a couple of inputs that you can change to tweak the patching process. They are specified in the with section and they are the following:

Name Requirement Description
version required The version to apply to the patched project, please make sure that the version that you are going to patch is compatible with the versioning used by your package manager
csproj-files optional The glob to use for finding C# projects, it needs to be compatible with @actions/glob
npm-files optional The glob to use for finding npm package.json files, it needs to be compatible with @actions/glob
setuppy-files optional The glob to use for finding Python/SetupTools setup.py files, it needs to be compatible with @actions/glob
initpy-files optional The glob to use for finding __init__.py files, it needs to be compatible with @actions/glob
fxmanifest-files optional The glob to use for finding cfx.re fxmanifest.lua files, it needs to be compatible with @actions/glob