Browse Source

Add pip gh action flow for test and prod (#13)

Marshall 1 year ago
parent
commit
701af73b9f
1 changed files with 46 additions and 0 deletions
  1. 46 0
      .github/workflows/ci-pip.yml

+ 46 - 0
.github/workflows/ci-pip.yml

@@ -0,0 +1,46 @@
+name: Publish Python Package
+
+on:
+  push:
+    tags:
+      - 'v*'
+
+jobs:
+  deploy:
+    runs-on: ubuntu-latest
+    environment: PyPi
+    permissions:
+      id-token: write  # IMPORTANT: this permission is mandatory for trusted publishing
+
+    defaults:
+      run:
+        working-directory: ./jito_searcher_client
+
+    steps:
+    - uses: actions/checkout@v3
+    
+    - name: Set up Python
+      uses: actions/setup-python@v4
+      with:
+        python-version: '3.x'
+    
+    - name: Install Poetry
+      uses: snok/install-poetry@v1
+      with:
+        version: latest
+        virtualenvs-create: true
+        virtualenvs-in-project: true
+    
+    - name: Install dependencies
+      run: |
+        poetry install --no-interaction
+    
+    - name: Build package
+      run: |
+        poetry build
+    
+    - name: Publish package
+      uses: pypa/gh-action-pypi-publish@v1.8.10
+      with:
+        password: ${{ secrets.PYPITOKEN }}
+        packages-dir: jito_searcher_client/dist/