Merge pull request #6 from PolicyEngine/dataset-param #17
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: Versioning updates | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - changelog.d/** | |
| - pyproject.toml | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| versioning: | |
| runs-on: ubuntu-latest | |
| if: | | |
| (!(github.event.head_commit.message == 'Update package version')) | |
| outputs: | |
| committed: ${{ steps.commit.outputs.committed }} | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install towncrier | |
| run: pip install towncrier | |
| - name: Bump version and build changelog | |
| run: | | |
| python .github/bump_version.py | |
| towncrier build --yes --version $(python -c "import re; print(re.search(r'version = \"(.+?)\"', open('pyproject.toml').read()).group(1))") | |
| - name: Commit version update | |
| id: commit | |
| uses: EndBug/add-and-commit@v9 | |
| with: | |
| add: "." | |
| message: Update package version | |
| publish: | |
| needs: versioning | |
| if: needs.versioning.outputs.committed == 'true' | |
| uses: ./.github/workflows/publish-pypi.yml | |
| secrets: inherit |