Added async manual bug report (#72) #20
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: Deploy and Publish | |
| on: | |
| push: | |
| branches: [prd, stg, dev] | |
| paths-ignore: # Pushes that include only these changed files won't trigger actions | |
| - "**/README.md" | |
| - "**/.gitignore" | |
| - "**/docs/*" | |
| - "**/.github/*" | |
| - "**/tests/*" | |
| - "**/_version.py" # Ignoring this ensures version updates don’t retrigger | |
| jobs: | |
| update-version: | |
| name: Update Version | |
| runs-on: ubuntu-latest | |
| permissions: write-all | |
| concurrency: | |
| group: version-update | |
| cancel-in-progress: false | |
| steps: | |
| - name: Update Version | |
| uses: byuawsfhtl/UpdateVersion@v1.0.7 | |
| with: | |
| token: ${{ secrets.RLL_BOT_PERSONAL_ACCESS_TOKEN }} | |
| versionPath: ${{ github.workspace }}/PyBugReporter/_version.py | |
| build: | |
| name: Build distribution 📦 | |
| if: github.ref == 'refs/heads/prd' # Only publish when pushing to prd | |
| needs: update-version | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.ref }} # Explicitly checkout the branch that triggered the workflow | |
| # This ensures we're using the latest commit including version updates | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Install pypa/build | |
| run: python3 -m pip install build | |
| - name: Build a binary wheel and a source tarball | |
| run: python3 -m build | |
| - name: Store the distribution packages | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| publish-to-pypi: | |
| name: Publish Python 🐍 distribution 📦 to PyPI | |
| if: github.ref == 'refs/heads/prd' # Only publish when pushing to prd | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/PyBugReporter | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 # Needed to ensure repo context | |
| - name: Download all the dists | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Verify dist exists | |
| run: ls -l dist/ | |
| - name: Publish distribution 📦 to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| username: __token__ | |
| password: ${{ secrets.PYPI_ACCESS_TOKEN }} |