Skip to content

Commit

Permalink
[CI] Prepare workflow for argilla-v1 - 1.29.0 (#5032)
Browse files Browse the repository at this point in the history
This PR reviews the `argilla-v1` release job and modifies the execution
conditions. In general (and this will apply to all the projects):

- Each project will release when merging changes to `main` (if paths
config detects project changes)
- The project release won't create a repo status. This tag must be
created from the `main` branch.
  • Loading branch information
frascuchon authored Jun 17, 2024
1 parent ec8b091 commit a3715c7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
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'

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"

0 comments on commit a3715c7

Please sign in to comment.