lfarci / github-actions

Preparation resources for the GitHub Actions certification
0 stars 0 forks source link

Demonstrate how to create a release strategy for an action (i.e. versioning) #56

Closed lfarci closed 3 months ago

lfarci commented 3 months ago

Creating a release strategy for a GitHub Action involves using semantic versioning and GitHub's release feature. Here's a step-by-step guide:

Semantic Versioning: Use semantic versioning for your action. This involves versioning your action as vMAJOR.MINOR.PATCH. For example, v1.0.0.

MAJOR version increment indicates that there are incompatible changes in your action. MINOR version increment indicates that you've added functionality in a backwards-compatible manner. PATCH version increment indicates that you've made backwards-compatible bug fixes. Create a Release: When you're ready to release a new version of your action, create a new release on GitHub.

Go to your action's repository on GitHub. Click on "Releases". Click "Draft a new release". Enter the version number in the "Tag version" field in the format vMAJOR.MINOR.PATCH. Enter a title and description for your release. The description should include a summary of the changes in this release. Click "Publish release". Use the Release in a Workflow: Users can now use the new version of your action in their workflows by referencing the version number. For example:

Maintain Old Versions: It's a good practice to maintain old versions of your action for a while after releasing a new major version. This gives users time to update their workflows to the new version.

Update the v1 Tag: If you're maintaining a v1 tag that always points to the latest v1.x.x release, don't forget to update this tag whenever you release a new v1.x.x version.

By following this release strategy, you can ensure that users always know what changes to expect when they update to a new version of your action.