Skip to content

Commit 0c98b6f

Browse files
authored
Update release_conda.yml
1 parent f49d811 commit 0c98b6f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/release_conda.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Checkout repository
2424
uses: actions/checkout@v3
2525
with:
26-
fetch-depth: 0 # Trae todo el historial y tags
26+
fetch-depth: 0 # necesario para que git describe detecte todos los tags
2727

2828
- name: Set up Miniconda
2929
uses: conda-incubator/setup-miniconda@v3
@@ -41,17 +41,22 @@ jobs:
4141
id: git_version
4242
run: echo "GIT_DESCRIBE_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
4343

44+
- name: Set dynamic version in meta.yaml
45+
run: |
46+
# Elimina la 'v' inicial si quieres solo números
47+
VERSION_NUMBER="${GIT_DESCRIBE_TAG#v}"
48+
# Reemplaza la línea de version en meta.yaml
49+
sed -i "s|^{% set version.*%}|{% set version = \"$VERSION_NUMBER\" %}|" .github/conda/meta.yaml
50+
4451
- name: Build conda package
4552
run: |
46-
echo "Using version $GIT_DESCRIBE_TAG"
53+
echo "Building package with version $VERSION_NUMBER"
4754
PACKAGE_FILE=$(conda build . --output)
4855
echo "Package built: $PACKAGE_FILE"
49-
shell: bash
5056
5157
- name: Upload package to Anaconda.org
5258
env:
5359
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
5460
run: |
5561
PACKAGE_FILE=$(conda build . --output)
5662
anaconda upload "$PACKAGE_FILE" --user ctlearn-project --label main --force
57-
shell: bash

0 commit comments

Comments
 (0)