Fix deploy workflow #26
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: CI/CD | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| Build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.8", "3.9", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| architecture: 'x64' | |
| - name: Install dependencies | |
| run: | | |
| pip install pytest --upgrade | |
| make install-dev | |
| - name: Run Lint | |
| run: make lint | |
| - name: Run Bandit | |
| run: make bandit | |
| - name: Run tests | |
| run: make test | |
| - name: Github ref | |
| run : echo "${{ github.ref }}" | |
| - name: Github event_name | |
| run : echo "${{ github.event_name }}" | |
| Deploy: | |
| runs-on: ubuntu-latest | |
| needs: [Build] | |
| # if: github.ref == 'refs/heads/master' && startsWith(github.ref, 'refs/tags') | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.8' | |
| architecture: 'x64' | |
| - name: Install needed packages to push new version on PyPi | |
| run: | | |
| pip install wheel | |
| pip install twine | |
| - name: Build spintest package | |
| run : | | |
| python setup.py bdist_wheel | |
| - name: Push to test pypi | |
| run: | | |
| twine upload --repository-url https://upload.pypi.org/legacy/ --username __token__ --password ${{ secrets.PYPI_TOKEN }} dist/* |