diff --git a/.github/workflows/package-publish.yml b/.github/workflows/package-publish.yml new file mode 100644 index 000000000000..748e89b05e40 --- /dev/null +++ b/.github/workflows/package-publish.yml @@ -0,0 +1,67 @@ +name: Publish + +on: + pull_request: + branches: + - master +env: + GKE_ZONE: us-east4 +jobs: + setup-build-publish: + name: Setup, Build, Publish + runs-on: [self-hosted, Linux, X64, low2c8gi] + + steps: + - name: get ENV shortname + run: | + if [[ "${{ github.event_name }}" == 'pull_request' ]]; then + branch=${GITHUB_BASE_REF} + elif [[ "${{ github.event_name }}" == 'push' ]]; then + branch=${GITHUB_REF##*/} + else + echo "Incorrect event type: ${{ github.event_name }}" + exit 1 + fi + + case $branch in + main) + echo "dev is for main" + echo "ENV_SHORT=dev" >> $GITHUB_ENV + echo "ENV_SECRET=DEV_GKE_SA_KEY" >> $GITHUB_ENV + ;; + esac + echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-7`" >> $GITHUB_ENV + + - name: Checkout + uses: actions/checkout@v2 + + - name: Install Python + uses: actions/setup-python@v1 + with: + python-version: 3.6 + + - uses: google-github-actions/setup-gcloud@v0.2.1 + with: + service_account_key: ${{ secrets[env.ENV_SECRET] }} + project_id: elementalcognition-app-${{ env.ENV_SHORT }} + + - name: Auth Docker + run: |- + gcloud --quiet auth configure-docker + + - name: Get GKE credentials + run: |- + gcloud container clusters get-credentials gke-ec-${{ env.ENV_SHORT }}-1 --zone "$GKE_ZONE" + + - name: Install + run: |- + pip install setuptools wheel twine + pip install -e . + + - name: Build + run: |- + python setup.py sdist bdist_wheel + + - name: Publish + run: |- + twine upload dist/* -r transformers --repository-url=https://nexus.src.elementalcognition.com/service/rest/repository/pypi-all/ -p anonymous -u anonymous diff --git a/setup.py b/setup.py index 87c18390fd06..30a2143b046e 100644 --- a/setup.py +++ b/setup.py @@ -63,6 +63,8 @@ import os import re import shutil + +import transformers from distutils.core import Command from pathlib import Path @@ -282,7 +284,7 @@ def run(self): setup( name="transformers", - version="4.4.0.dev0", # expected format is one of x.y.z.dev0, or x.y.z.rc1 or x.y.z (no to dashes, yes to dots) + version=transformers.__version__, # expected format is one of x.y.z.dev0, or x.y.z.rc1 or x.y.z (no to dashes, yes to dots) author="Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Sam Shleifer, Patrick von Platen, Sylvain Gugger, Google AI Language Team Authors, Open AI team Authors, Facebook AI Authors, Carnegie Mellon University Authors", author_email="thomas@huggingface.co", description="State-of-the-art Natural Language Processing for TensorFlow 2.0 and PyTorch", diff --git a/src/transformers/__init__.py b/src/transformers/__init__.py index 0856c68edcf3..4d970c10d7a9 100755 --- a/src/transformers/__init__.py +++ b/src/transformers/__init__.py @@ -22,7 +22,7 @@ # to defer the actual importing for when the objects are requested. This way `import transformers` provides the names # in the namespace without actually importing anything (and especially none of the backends). -__version__ = "4.4.0.dev0" +__version__ = "4.4.0.dev1" # Work around to update TensorFlow's absl.logging threshold which alters the # default Python logging output behavior when present.