-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
129 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Publish Package | ||
|
||
on: | ||
push: | ||
tags: ["v*.*.*"] | ||
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 | ||
|
||
- name: Run Version Verification | ||
run: | | ||
python -c "from config import CONFIG; import os; current_tag = os.getenv('IMAGE_TAG'); assert CONFIG.VERSION == current_tag, 'Version mismatch: Expected {} but got {}'.format(CONFIG.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: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
|
||
- name: Create Release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ env.IMAGE_TAG }} | ||
release_name: Release ${{ env.IMAGE_TAG }} | ||
body: | | ||
This is the release for version ${{ env.IMAGE_TAG }}. | ||
draft: false | ||
prerelease: false |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Run test | ||
|
||
on: | ||
pull_request: | ||
branches: [ "master" ] | ||
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 | ||
|
||
- name: Run Tests | ||
env: | ||
CLIENT_TEST_ENV: ${{ secrets.CLIENT_TEST_ENV }} | ||
run: | | ||
echo "$CLIENT_TEST_ENV" > .env | ||
bash ./test/run_test.sh |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
__title__ = "taskingai" | ||
__version__ = "0.1.3" | ||
__version__ = "0.2.0" |
This file contains 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