Skip to content

Commit

Permalink
version ci
Browse files Browse the repository at this point in the history
  • Loading branch information
awnion committed Sep 8, 2024
1 parent a2d323b commit 22e8b94
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release "afio" Font

on:
push:
branches:
- main
- ci/*

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Get current version from tags
id: get_version
run: |
# Get the latest tag, filter to versions with "v" prefix, sort them by version, and take the latest
VERSION=$(git describe --tags --match "v[0-9]*" --abbrev=0 2>/dev/null || echo "v0.0.0")
echo "Current version: $VERSION"
echo "version=$VERSION" >> $GITHUB_ENV
- name: Bump patch version
id: bump_version
run: |
# Strip the "v" and split into major, minor, patch
VERSION=${{ env.version }}
VERSION_NUMBER=$(echo $VERSION | sed 's/v//')
MAJOR=$(echo $VERSION_NUMBER | cut -d. -f1)
MINOR=$(echo $VERSION_NUMBER | cut -d. -f2)
PATCH=$(echo $VERSION_NUMBER | cut -d. -f3)
NEW_VERSION="v$MAJOR.$MINOR.$((PATCH + 1))"
echo "New version: $NEW_VERSION"
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
- name: Tag the new version
run: |
git tag ${{ env.new_version }}
git push origin ${{ env.new_version }}

0 comments on commit 22e8b94

Please sign in to comment.