Skip to content

Automatically create a release whenever the version changes in a properties file

License

Notifications You must be signed in to change notification settings

profusion/action-autorelease

Repository files navigation

Auto Release

This script enables the automatic creation of GitHub releases when a specific property in a properties file changes. It can be useful for publishing packages automatically when certain properties, such as version numbers, change.

Usage

The following is an example .github/workflows/main.yml that will execute when a push to the main branch occurs.

name: Auto Release

on:
  push:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
        - uses: actions/checkout@v3
        - uses: profusion/autorelease@main
            with:
            properties_path: "gradle.properties"
            property_name: "VERSION_NAME"
            tag_prefix: "v"
            github_token: ${{ secrets.GITHUB_TOKEN }}

To make this work, the workflow must have the checkout action before the autotag action.

This order is important!

- uses: actions/checkout@v3
- uses: profusion/action-autotag@main

If the repository is not checked out first, the script cannot find the properties file.

Configurations

  1. github_token: This is the token used to create the tag. It is required.

  2. properties_path: This is the path to the properties file. It is required.

  3. property_name: This is the name of the property that will be used to create the tag. It is required.

  4. tag_prefix: A prefix can be used to add text before the tag name. For example, if tag_prefix is set to v, then the tag would be labeled as v1.0.0.

  5. tag_suffix: Text can also be applied to the end of the tag by setting tag_suffix. For example, if tag_suffix is (beta), the tag would be 1.0.0 (beta).

Development

In order to contribute, clone the repository and set up husky hooks prior to submitting a patch:

git clone git@github.com:profusion/action-autorelease.git
cd action-autorelease
yarn
yarn prepare
yarn all # run build, format, lint and package

About

Automatically create a release whenever the version changes in a properties file

Resources

License

Stars

Watchers

Forks