Enable workflows for main branch (#502) #5
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: Conditional Bump Version | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - .* | |
| - .github/*/*.md | |
| - .github/*/*.yml | |
| - AUTHORS.rst | |
| - CHANGELOG.rst | |
| - CI/*.in | |
| - CI/*.txt | |
| - Dockerfile | |
| - Makefile | |
| - docker-compose.yml | |
| - docs/*/*.ipynb | |
| - docs/*/*.py | |
| - docs/*/*.rst | |
| - docs/Makefile | |
| - docs/_static/* | |
| - environment-dev.yml | |
| - environment-docs.yml | |
| - environment.yml | |
| - pyproject.toml | |
| - src/finch/__version__.py | |
| permissions: | |
| contents: read | |
| jobs: | |
| bump_patch_version: | |
| name: Bumpversion Patch | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: read | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 | |
| with: | |
| disable-sudo: true | |
| egress-policy: block | |
| allowed-endpoints: > | |
| api.github.com:443 | |
| files.pythonhosted.org:443 | |
| github.com:443 | |
| pypi.org:443 | |
| - name: Generate App Token | |
| id: token_generator | |
| uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 | |
| with: | |
| app-id: ${{ secrets.BIRDHOUSE_HELPER_BOT_ID }} | |
| private-key: ${{ secrets.BIRDHOUSE_HELPER_BOT_KEY }} | |
| - name: Checkout Repository | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| token: ${{ steps.token_generator.outputs.token }} | |
| persist-credentials: false | |
| - name: Set up Python3 | |
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version: "3.x" | |
| - name: Import GPG Key | |
| uses: crazy-max/ghaction-import-gpg@e89d40939c28e39f97cf32126055eeae86ba74ec # v6.3.0 | |
| with: | |
| gpg_private_key: ${{ secrets.BIRDHOUSE_HELPER_BOT_GPG_PRIVATE_KEY }} | |
| passphrase: ${{ secrets.BIRDHOUSE_HELPER_BOT_GPG_PRIVATE_KEY_PASSWORD }} | |
| git_user_signingkey: true | |
| git_commit_gpgsign: true | |
| trust_level: 5 | |
| - name: Install CI libraries | |
| run: | | |
| python -m pip install --require-hashes -r CI/requirements_ci.txt | |
| - name: Conditional Bump | |
| run: | | |
| CURRENT_VERSION=$(bump-my-version show current_version) | |
| if [[ ${CURRENT_VERSION} =~ -dev(\.\d+)? ]]; then | |
| echo "Development version (ends in 'dev(\.\d+)?'), bumping 'build' version" | |
| bump-my-version bump build | |
| else | |
| echo "Version is stable, bumping 'patch' version" | |
| bump-my-version bump patch | |
| fi | |
| echo "new_version=$(bump-my-version show current_version)" | |
| - name: Push Changes | |
| uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # v0.8.0 | |
| with: | |
| force: false | |
| branch: ${{ github.ref }} | |
| github_token: ${{ steps.token_generator.outputs.token }} |