Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling the automatic release creation via pipeline #30

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/ci-cd-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# GitHub CI build pipeline to trigger the tag creation after the merge
name: CI/CD Pipeline

on:
pull_request:
types:
- closed
branches:
- master

jobs:
TagCreation:
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'Release')
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: '0'

- name: Parsing tag name from the branch
id: tagDetails
run: |
echo "Branch name is ${{ github.event.pull_request.head.ref }}"
tagName=$(echo ${{ github.event.pull_request.head.ref }} | grep -oP 'v\d+\.\d+\.\d+' | sed 's/^//')
echo "tagName=$tagName" >> $GITHUB_OUTPUT

- name: Tag name
run: |
echo ${{ steps.tagDetails.outputs.tagName }}

- uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tagDetails.outputs.tagName }}
token: "${{ secrets.GITHUB_TOKEN }}"
generateReleaseNotes: "true"