Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
evanharmon1 committed Oct 26, 2024
1 parent 4e5858f commit 2dd9d35
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ on:
jobs:
bump-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for versioning

- name: Get Latest Tag
id: get_latest_tag
Expand All @@ -29,27 +33,33 @@ jobs:
run: |
MAJOR=$(echo "${{ env.VERSION }}" | cut -d. -f1)
MINOR=$(echo "${{ env.VERSION }}" | cut -d. -f2)
PATCH=$(echo "${{ env.VERSION }}" | cut -d. -f3)
echo "MAJOR=${MAJOR}" >> $GITHUB_ENV
echo "MINOR=${MINOR}" >> $GITHUB_ENV
echo "PATCH=${PATCH}" >> $GITHUB_ENV
- name: Calculate New Minor Version
id: calculate_new_version
- name: Calculate New Patch Version
id: calculate_new_patch_version
run: |
NEW_MINOR=$(( ${{ env.MINOR }} + 1 ))
NEW_VERSION="v${{ env.MAJOR }}.${NEW_MINOR}.0"
NEW_PATCH=$(( ${{ env.PATCH }} + 1 ))
NEW_VERSION="v${{ env.MAJOR }}.${{ env.MINOR }}.${{ NEW_PATCH }}"
echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_ENV
- name: Display Version Info
run: |
echo "Latest tag is ${{ env.LATEST_TAG }}"
echo "Current version is ${{ env.VERSION }}"
echo "Bumping minor version to ${{ env.NEW_VERSION }}"
echo "Bumping patch version to ${{ env.NEW_VERSION }}"
- name: Create New Git Tag
run: |
git tag "${{ env.NEW_VERSION }}"
git push origin "${{ env.NEW_VERSION }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create GitHub Release
run: |
gh release create "${{ env.NEW_VERSION }}" --generate-notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 2dd9d35

Please sign in to comment.