Rev and Publish Eidolon Projects #23
This file contains 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: Rev and Publish Python Projects | |
on: | |
workflow_run: | |
workflows: ["Test"] # The name of the test workflow | |
types: | |
- completed | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
publish: | |
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_PAT }} | |
fetch-depth: 0 | |
- name: Install poetry | |
run: pipx install poetry | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
cache: 'poetry' | |
- name: "Versioning Eidolon Dependencies" | |
run: | | |
make version | |
echo "TAGGING_MESSAGE=$(make -C scripts -s run get_tags)" >> $GITHUB_ENV | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "bumping versions" | |
tagging_message: ${{ env.TAGGING_MESSAGE }} | |
- name: "Publishing changes to PyPI" | |
run: | | |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} | |
make publish | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
id: pyp-publish-commit | |
with: | |
commit_message: "changes occurred while publishing" | |
- name: "ERROR: Publish to PyPI should not cause changes" | |
if: steps.pyp-publish-commit.outputs.changes_detected == 'true' | |
run: exit 1 |