Build, Test, Publish Github and PyPI Releases #2
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: Build, Test, Publish Github and PyPI Releases | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| publish_github_release_and_pypi: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out the repository | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b | |
| with: | |
| python-version: '3.11' | |
| - name: Install pip and poetry | |
| run: | | |
| python -m pip install --root-user-action=ignore --upgrade pip | |
| pip install --root-user-action=ignore poetry | |
| make venv | |
| - name: Build Release tar.gz | |
| run: | | |
| make build | |
| - name: Install Build and Run PAT Tests | |
| run: | | |
| poetry run pip install --root-user-action=ignore dist/panther_analysis_tool-*.tar.gz | |
| make test integration | |
| - name: Create Github Release | |
| run: | | |
| export NEW_VERSION=$(poetry version -s) | |
| git config user.name "dac-bot" | |
| git config user.email "[email protected]" | |
| gh release create v$NEW_VERSION dist/* -t v$NEW_VERSION --draft | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish to PyPI | |
| run: | | |
| poetry config repositories.testpypi https://test.pypi.org/legacy/ | |
| make release | |
| env: | |
| PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} |