Skip to content
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

Pypi Deployment #295

Merged
merged 2 commits into from
Aug 11, 2024
Merged
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
56 changes: 56 additions & 0 deletions .github/workflows/pypi-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# PyPi
name: PyPi Deployment

on:

# Run this workflow manually from Actions tab
workflow_dispatch:
inputs:
release_tag:
description: 'Moonshot Release Tag'
required: true
type: string

# Allow one concurrent deployment
concurrency:
group: ${{ github.repository }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
pypi-deployment:

runs-on: ubuntu-latest
timeout-minutes: 20

steps:

- name: Checkout Moonshot
uses: actions/checkout@v4
with:
repository: aiverify-foundation/moonshot
ref: main

- name: Setup Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Setup Build & Twine
run: |
python -m venv venv
source venv/bin/activate
python3 -m pip install --upgrade build
python3 -m pip install --upgrade twine

- name: Build & Deploy Package to PyPi
run: |
python -m build
python -m twine upload dist/* -${{ secrets.PROD_PYPI_TOKEN }}

- name: Test Deployed Package
run: |
cd ../test
rm -rf *
pip install "aiverify-moonshot[all]"
python -m moonshot -i moonshot-data -i moonshot-ui
python -m moonshot web &
58 changes: 58 additions & 0 deletions .github/workflows/test-pypi-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Test PyPi
name: Test PyPi Deployment

on:

# Run this workflow manually from Actions tab
workflow_dispatch:
inputs:
test_release_tag:
description: 'Moonshot Release Tag'
required: true
type: string

# Allow one concurrent deployment
concurrency:
group: ${{ github.repository }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
pypi-deployment:

runs-on: ubuntu-latest
timeout-minutes: 20

steps:

- name: Checkout Moonshot
uses: actions/checkout@v4
with:
repository: aiverify-foundation/moonshot
ref: main

- name: Setup Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Setup Build & Twine
run: |
python -m venv venv
source venv/bin/activate
python3 -m pip install --upgrade build
python3 -m pip install --upgrade twine

- name: Build & Deploy Package to Test PyPi
run: |
python -m build
python -m twine upload --repository testpypi dist/* -${{ secrets.TEST_PYPI_TOKEN }}

- name: Test Package
run: |
cd ../
mkdir test & cd test
python3 -m venv venv
source venv/bin/activate
pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple "aiverify-moonshot==${{ inputs.test_release_tag }}"
python -m moonshot -i moonshot-data -i moonshot-ui
python -m moonshot web &
Loading