1
0
Fork 0
mirror of synced 2024-05-26 23:40:05 +12:00
Rare/.github/workflows/job_version.yml
loathingKernel beb4f6c310 Workflows: Update Windows packages to python 3.12
Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2024-05-16 13:57:30 +03:00

36 lines
1.2 KiB
YAML

name: job_version
on:
workflow_call:
outputs:
version:
value: "${{ jobs.version.outputs.tag_abbrev }}.${{ jobs.version.outputs.tag_offset }}"
branch:
value: "${{ jobs.version.outputs.branch }}"
jobs:
version:
name: Version
runs-on: ubuntu-latest
outputs:
tag_abbrev: ${{ steps.describe.outputs.tag_abbrev }}
tag_offset: ${{ steps.describe.outputs.tag_offset }}
sha_short: ${{ steps.describe.outputs.sha_short }}
full_desc: ${{ steps.describe.outputs.full_desc }}
branch: ${{ steps.describe.outputs.branch }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Describe
id: describe
shell: bash
run: |
tag_abbrev=$(git tag --sort=v:refname | grep -oE "(^[0-9]+\.[0-9]+(.[0-9]+)?)$" | tail -1)
echo "tag_abbrev=$tag_abbrev" >> $GITHUB_OUTPUT
echo "tag_offset=$(git rev-list $tag_abbrev..HEAD --count)" >> $GITHUB_OUTPUT
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "full_desc=$(git describe --long --tags)" >> $GITHUB_OUTPUT
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT