Skip to content

Commit

Permalink
test deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
devvyyxyz committed Dec 9, 2024
1 parent 6a45aaa commit a7179f2
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/deploy-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,33 @@ jobs:
echo "Total commits: $total_commits"
echo "total_commits=$total_commits" >> $GITHUB_ENV
- name: Create Release
id: create_release
- name: Calculate version
id: calculate_version
run: |
version="v${{ env.total_commits }}"
major_version=1 # Start with major version 1 (manual increments needed)
# If the commit count is divisible by 10, create a major release
if [ $(( $total_commits % 10 )) -eq 0 ]; then
version="v$(($total_commits / 10))0.0"
# Calculate the minor version based on commit count
minor_version=$(( (total_commits / 10) % 10 )) # Every 10 commits, increment minor version
patch_version=$(( total_commits % 10 )) # Increment patch version for each commit
# If it's a major release (every 10 commits), reset patch version
if [ $((total_commits % 10)) -eq 0 ] && [ $total_commits -gt 0 ]; then
minor_version=$(( minor_version + 1 ))
patch_version=0
fi
echo "Creating release with version $version"
version="v${major_version}.${minor_version}.${patch_version}"
echo "Calculated version: $version"
echo "version=$version" >> $GITHUB_ENV
- name: Create Release
id: create_release
run: |
echo "Creating release with version ${{ env.version }}"
# Create release using GitHub CLI or API
gh release create $version --title "Release $version" --notes "Automated release for commit $total_commits"
gh release create ${{ env.version }} --title "Release ${{ env.version }}" --notes "Automated release for commit ${{ env.total_commits }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit a7179f2

Please sign in to comment.