0.2.5 #11
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Package | |
on: | |
release: | |
types: [ published ] | |
tags: ["*.*.*"] | |
paths-ignore: | |
- '**.md' | |
- '**.svg' | |
- '**.jpg' | |
- '**.png' | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: test | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Set short SHA | |
run: echo "IMAGE_TAG=$(echo ${{ github.sha }} | cut -c 1-7)" >> $GITHUB_ENV | |
- name: Check for git tag version | |
id: get_tag | |
run: | | |
TAG=$(git describe --tags --exact-match 2> /dev/null || echo "") | |
if [[ -n "$TAG" ]]; then | |
echo "IMAGE_TAG=${TAG}" >> $GITHUB_ENV | |
fi | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.x | |
- name: Install Dependencies | |
run: | | |
pip install -r requirements.txt | |
pip install -r test_requirements.txt | |
- name: Run Version Verification | |
run: | | |
python -c "from taskingai import __version__; import os; current_tag = os.getenv('IMAGE_TAG'); assert __version__ == current_tag, 'Version mismatch: Expected {} but got {}'.format(__version__, current_tag); print('Version matched!')" | |
- name: Install Twine | |
run: | | |
python -m pip install --upgrade pip | |
pip install twine | |
- name: Run Tests | |
env: | |
CLIENT_TEST_ENV: ${{ secrets.CLIENT_TEST_ENV }} | |
run: | | |
echo "$CLIENT_TEST_ENV" > .env | |
bash ./test/run_test.sh | |
- name: Build Package | |
run: python setup.py sdist bdist_wheel | |
- name: Publish Package | |
run: twine upload dist/* | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} |