Skip to content

feat: publish packages to nexus (PLT-375) #5

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/package-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Publish

on:
pull_request:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please note: that it is just for testing and in the release will be changed to push

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/[email protected]
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
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
import os
import re
import shutil

import transformers
from distutils.core import Command
from pathlib import Path

Expand Down Expand Up @@ -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="[email protected]",
description="State-of-the-art Natural Language Processing for TensorFlow 2.0 and PyTorch",
Expand Down
2 changes: 1 addition & 1 deletion src/transformers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down