Skip to content

Instantly share code, notes, and snippets.

@eliseuborges
Last active February 16, 2021 22:11
Show Gist options
  • Save eliseuborges/2ad3db492489c8f8f4834ba22e89fadc to your computer and use it in GitHub Desktop.
Save eliseuborges/2ad3db492489c8f8f4834ba22e89fadc to your computer and use it in GitHub Desktop.
Action to generate release and tag number automatically
name: CI
on:
push:
branches: [ main ]
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Git Semantic Version
id: semantic_version
uses: PaulHatch/semantic-version@v4
with:
short_tags: true
tag_prefix: "v"
format: "${major}.${minor}.${patch}"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: v${{ steps.semantic_version.outputs.version }}
release_name: v${{ steps.semantic_version.outputs.version }}
draft: false
prerelease: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment