v3.1.2 - Важное исправление #14
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] | |
| workflow_dispatch: | |
| permissions: | |
| id-token: write | |
| contents: write | |
| jobs: | |
| test: | |
| name: Run Tests and Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Run tests | |
| env: | |
| SELLER_ID: ${{ secrets.SELLER_ID }} | |
| API_KEY: ${{ secrets.API_KEY }} | |
| run: | | |
| python -m unittest tests/re_test.py | |
| - name: Install Build Tools | |
| run: python -m pip install build | |
| - name: Build package | |
| run: python -m build | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-dists | |
| path: dist/ | |
| publish: | |
| name: Publish to PyPI and GitHub Release | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - name: Download Artifacts | |
| uses: actions/[email protected] | |
| with: | |
| name: release-dists | |
| path: dist/ | |
| - name: Publish to PyPI | |
| uses: pypa/[email protected] | |
| - name: Upload Files to GitHub Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: > | |
| gh release upload | |
| '${{ github.event.release.tag_name }}' dist/** | |
| --repo '${{ github.repository }}' |