-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (35 loc) · 1.04 KB
/
reusable-version-info.yml
File metadata and controls
39 lines (35 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
on:
workflow_call:
inputs:
python_version:
required: false
default: '3.12'
type: string
outputs:
version:
value: ${{ jobs.version_info.outputs.version }}
version_tag:
value: ${{ jobs.version_info.outputs.version_tag }}
jobs:
version_info:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.set_outputs.outputs.version }}
version_tag: ${{ steps.set_outputs.outputs.version_tag }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: mamba-org/setup-micromamba@v2
with:
environment-file: environment.yml
create-args: >-
python=${{ inputs.python_version }}
- name: set outputs
id: set_outputs
shell: bash -l {0}
run: |
export SDIST_VERSION=$(python -m setuptools_scm)
echo "version=${SDIST_VERSION}" >> $GITHUB_OUTPUT
echo "version_tag=${SDIST_VERSION/+/_}" >> $GITHUB_OUTPUT
echo "Version number: ${SDIST_VERSION}"