Create sbom.yml #67
Workflow file for this run
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: Bump Version | |
on: | |
pull_request_target: | |
types: | |
- closed | |
jobs: | |
bump-version: | |
name: Bump Version | |
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == github.event.repository.default_branch | |
runs-on: ubuntu-20.04 | |
env: | |
PR_BRANCH_REF: ${{ github.event.pull_request.head.ref }} | |
PR_BRANCH_SHA: ${{ github.event.pull_request.head.sha }} | |
permissions: | |
id-token: write | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install poetry | |
run: pipx install poetry | |
- name: Bump version | |
run: echo "$(./.github/version.py ${{ env.PR_BRANCH_REF }})" >> $GITHUB_ENV | |
- name: Update repository | |
if: ${{ env.NEW_VERSION != '' }} | |
run: | | |
echo ${{ env.NEW_VERSION }} | |
git config --global user.name 'github-actions' | |
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
git add pyproject.toml | |
git commit -m "Update version to ${{ env.NEW_VERSION }}" | |
git tag v${{ env.NEW_VERSION }} | |
git push --atomic origin ${{ github.event.repository.default_branch }} v${{ env.NEW_VERSION }} | |
- name: Build package | |
run: poetry build | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |