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.
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.
-
github_token
: This is the token used to create the tag. It is required. -
properties_path
: This is the path to the properties file. It is required. -
property_name
: This is the name of the property that will be used to create the tag. It is required. -
tag_prefix
: A prefix can be used to add text before the tag name. For example, iftag_prefix
is set tov
, then the tag would be labeled asv1.0.0
. -
tag_suffix
: Text can also be applied to the end of the tag by settingtag_suffix
. For example, iftag_suffix
is(beta)
, the tag would be1.0.0 (beta)
.
In order to contribute, clone the repository and set up husky hooks prior to submitting a patch:
git clone [email protected]:profusion/action-autorelease.git
cd action-autorelease
yarn
yarn prepare
yarn all # run build, format, lint and package