Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Prepare workflow for argilla-v1 - 1.29.0 #5032

Merged
merged 11 commits into from
Jun 17, 2024
38 changes: 24 additions & 14 deletions .github/workflows/argilla-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ concurrency:

on:
workflow_dispatch:
workflow_call:

push:
paths:
Expand Down Expand Up @@ -102,37 +101,48 @@ jobs:
publish_release:
name: Publish Release
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' }}
if: github.ref == 'refs/heads/main' || ${{ github.event_name }} == 'workflow_dispatch'
frascuchon marked this conversation as resolved.
Show resolved Hide resolved

permissions:
# This permission is needed for private repositories.
# contents: read
# IMPORTANT: this permission is mandatory for trusted publishing on PyPI
id-token: write
# This permission is needed for creating tags
contents: write

needs:
- build

defaults:
run:
shell: bash -l {0}
working-directory: argilla-v1

steps:
- name: Checkout Code 🛎
uses: actions/checkout@v4

- name: Download python package
uses: actions/download-artifact@v4
with:
name: argilla-v1
path: dist

- name: Read package info
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=$PACKAGE_NAME" >> $GITHUB_ENV
echo "$PACKAGE_NAME==$PACKAGE_VERSION"

- name: Publish Package to TestPyPI 🥪
uses: pypa/gh-action-pypi-publish@release/v1
continue-on-error: true
with:
user: __token__
password: ${{ secrets.AR_TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/

- name: Test Installing 🍿
continue-on-error: true
run: pip install --index-url https://test.pypi.org/simple --no-deps argilla==${GITHUB_REF#refs/*/v}
run: pip install --upgrade --no-deps --force-reinstall --index-url https://test.pypi.org/simple $PACKAGE_NAME==$PACKAGE_VERSION

- name: Publish Package to PyPI 🥩
if: github.ref == 'refs/heads/main'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.AR_PYPI_API_TOKEN }}
2 changes: 1 addition & 1 deletion argilla-v1/src/argilla_v1/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# limitations under the License.

# coding: utf-8
version = "1.29.0-alpha.1"
version = "1.29.0-alpha0"
Loading