Skip to content

Publish Create Tag and Git Release #6

Publish Create Tag and Git Release

Publish Create Tag and Git Release #6

name: Publish Create Tag and Git Release
on:
workflow_dispatch: # Allows manual triggering of the action remotely
permissions: write-all
defaults:
run:
working-directory: ./likeminds-chat-reactnative-integration
jobs:
create_tag:
name: Create Git Tag
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/bugfix/LM-12380_chatStabilityBugs'
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check for version changes
run: |
# Fetch all tags from the remote repository
git fetch --tags
# Get the previous version from the last release tag
export previous_version=$(git describe --tags --abbrev=0)
# Get the current version from package.json
export current_version=$(cat package.json | grep '"version":' | awk -F'"' '{print $4}')
if [[ "$previous_version" != "v$current_version" ]]; then
echo "Version has changed from $previous_version to v$current_version."
else
echo "Version has not changed."
exit 1
fi
- name: Push Git Tag
run: echo "test"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
create-github-release:
name: Create GitHub Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/bugfix/LM-12380_chatStabilityBugs'
needs: create_tag
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Create Release
run: echo "test"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}