Skip to content

Commit

Permalink
👷 Add publish to pypi
Browse files Browse the repository at this point in the history
Signed-off-by: Evaline Ju <[email protected]>
  • Loading branch information
evaline-ju committed Jun 26, 2023
1 parent 0933606 commit ba73821
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/publish-library.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright The Caikit Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Publish

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
- name: Release
env:
FLIT_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
pip install tox
RELEASE_VERSION=${GITHUB_REF#refs/*/}
RELEASE_VERSION=${RELEASE_VERSION#v*}
sed -i "s/^version = .*/version = \"${RELEASE_VERSION}\"/" pyproject.toml
tox -e publish
10 changes: 10 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,13 @@ skip_install = True # Skip package install since fmt doesn't need to execute cod
description = lint with pylint
deps = pylint>=2.16.2,<3.0
commands = pylint caikit_nlp

[testenv:publish]
description = publish wheel to pypi
deps = flit==3.8
passenv =
FLIT_PASSWORD
setenv =
FLIT_USERNAME = __token__
commands = flit publish
skip_install = True

0 comments on commit ba73821

Please sign in to comment.