Trying to use
Some checks failed
sample gradle build and test / build (pull_request) Successful in 1m39s
sample gradle build and test / build (push) Failing after 15s

This commit is contained in:
hitanshu310 2025-06-10 21:46:10 +05:30
parent 8720810c46
commit 6262c84535

View File

@ -24,19 +24,19 @@ jobs:
id: get_tag id: get_tag
run: | run: |
VERSION=$(git describe --tags --abbrev=0) VERSION=$(git describe --tags --abbrev=0)
echo "VERSION=${VERSION}" >> $GITEA_OUTPUT echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
MAJOR=$(echo ${VERSION} | cut -d "." -f 1) MAJOR=$(echo ${VERSION} | cut -d "." -f 1)
echo "MAJOR=${MAJOR}" >> $GITEA_OUTPUT echo "MAJOR=${MAJOR}" >> $GITHUB_OUTPUT
MINOR=$(echo ${VERSION} | cut -d "." -f 2) MINOR=$(echo ${VERSION} | cut -d "." -f 2)
echo "MINOR=${MINOR}" >> $GITEA_OUTPUT echo "MINOR=${MINOR}" >> $GITHUB_OUTPUT
PATCH=$(echo ${VERSION} | cut -d "." -f 3) PATCH=$(echo ${VERSION} | cut -d "." -f 3)
echo "PATCH=${PATCH}" >> $GITEA_OUTPUT echo "PATCH=${PATCH}" >> $GITHUB_OUTPUT
- name: Increment version - name: Increment version
id: calc_new_tag id: calc_new_tag
run: | run: |
echo "${{ steps.get_id.outputs.PATCH }}" echo "${{ steps.get_id.outputs.PATCH }}"
echo "NEW_PATCH=$(( ${{ steps.get_id.outputs.PATCH }} + 1))" >> $GITEA_OUTPUT echo "NEW_PATCH=$(( ${{ steps.get_id.outputs.PATCH }} + 1))" >> $GITHUB_OUTPUT
echo "NEW_VERSION=$( ${{ steps.get_id.outputs.MAJOR }}.${{ steps.get_id.outputs.MINOR }}.${NEW_PATCH})" >> $GITEA_OUTPUT echo "NEW_VERSION=$( ${{ steps.get_id.outputs.MAJOR }}.${{ steps.get_id.outputs.MINOR }}.${NEW_PATCH})" >> $GITHUB_OUTPUT
- name: Create and push tag - name: Create and push tag
run: | run: |
git tag -a ${{ steps.calc_new_tag.outputs.NEW_VERSION }} -m "Pushing new version ${{ steps.calc_new_tag.outputs.NEW_VERSION }}" git tag -a ${{ steps.calc_new_tag.outputs.NEW_VERSION }} -m "Pushing new version ${{ steps.calc_new_tag.outputs.NEW_VERSION }}"