Skip to content

Commit

Permalink
ci: run release job also manually only for tests.pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
frascuchon committed Jun 17, 2024
1 parent 74ef8c0 commit 26b193f
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/argilla-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ concurrency:
cancel-in-progress: true

on:
workflow_dispatch:

push:
paths:
- argilla-v1/**
Expand Down Expand Up @@ -100,6 +102,7 @@ jobs:
publish_release:
name: Publish Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/stable' || ${{ github.event_name }} == 'workflow_dispatch'

permissions:
# This permission is needed for private repositories.
Expand All @@ -126,18 +129,11 @@ jobs:
run: |
pip install --no-deps dist/*.whl
PACKAGE_VERSION=$(python -c 'from importlib.metadata import version; print(version("argilla-v1"))')
PACKAGE_NAME=argilla-v1
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
echo "PACKAGE_NAME=argilla-v1" >> $GITHUB_ENV
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV
echo "$PACKAGE_NAME==$PACKAGE_VERSION"
- name: Create tag
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
TAG=${{ env.PACKAGE_NAME }}.v${{ env.PACKAGE_VERSION }}
git tag -f -a $TAG -m "Release ${{ env.PACKAGE_NAME }} v${{ env.PACKAGE_VERSION }}"
git push -f origin $TAG
- name: Publish Package to TestPyPI 🥪
uses: pypa/gh-action-pypi-publish@release/v1
continue-on-error: true
Expand All @@ -149,5 +145,13 @@ jobs:
run: pip install --upgrade --no-deps --force-reinstall --index-url https://test.pypi.org/simple $PACKAGE_NAME==$PACKAGE_VERSION

- name: Publish Package to PyPI 🥩
uses: pypa/gh-action-pypi-publish@release/v1
if: github.ref == 'refs/heads/stable'
uses: pypa/gh-action-pypi-publish@release/v1

- name: Create tag
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
TAG=${{ env.PACKAGE_NAME }}_${{ env.PACKAGE_VERSION }}
git tag -f -a $TAG -m "Release ${{ env.PACKAGE_NAME }} v${{ env.PACKAGE_VERSION }}"
git push -f origin $TAG

0 comments on commit 26b193f

Please sign in to comment.