Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bau auto bump version #97

Merged
merged 12 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions .github/workflows/test-and-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ name: Test and Tag
# for that version.
# If a tag already exists with that name, the Create Release step is skipped.

# Currently version must be manually updated in setup.py to enable this tagging job to run

on:
workflow_dispatch:
Expand Down Expand Up @@ -50,16 +49,30 @@ jobs:
python-version: '3.10'
- name: Get package version
id: package_version
run: echo "::set-output name=app_version::"$(python setup.py --version)
- name: Print package version
id: print_version
run: echo ${{ steps.package_version.outputs.app_version}}
run: echo "app_version="$(python setup.py --version) >> $GITHUB_OUTPUT
- name: Bump release version
id: bump_version
uses: christian-draeger/[email protected]
with:
current-version: ${{ steps.package_version.outputs.app_version}}
version-fragment: 'bug'

- name: Update version in pyproject.toml
id: update_version
run: |
echo Updating version from ${{ steps.package_version.outputs.app_version}} to ${{ steps.bump_version.outputs.next-version }}
sed -i 's/version = "${{ steps.package_version.outputs.app_version}}"/version = "${{ steps.bump_version.outputs.next-version }}"/' pyproject.toml
git config user.name 'FSD Github Actions'
git add pyproject.toml
git commit -m "Version bump in action"
git push origin $GITHUB_HEAD_REF
echo "Updated pyproject.toml with version ${{ steps.bump_version.outputs.next-version }}" >> $GITHUB_STEP_SUMMARY

- name: Check if tag exists
uses: mukunku/[email protected]
id: check_tag
with:
tag: ${{ steps.package_version.outputs.app_version}}
tag: ${{ steps.bump_version.outputs.next-version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -69,7 +82,7 @@ jobs:
if: ${{ steps.check_tag.outputs.exists == 'false' }}
with:
commit: main
tag: ${{ steps.package_version.outputs.app_version }}
tag: ${{ steps.bump_version.outputs.next-version }}
token: ${{ secrets.GITHUB_TOKEN }}

publish-release:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "funding-service-design-utils"
version = "2.0.15"
version = "2.0.17"
authors = [
{ name="DLUHC", email="[email protected]" },
]
Expand Down