Skip to content
This repository was archived by the owner on Sep 2, 2022. It is now read-only.

Commit e759f01

Browse files
authored
Merge pull request #12 from apilytics/simplify-cd
Simplify CD pipeline, get rid of EndBug/add-and-commit action
2 parents c63dab5 + 99a9daa commit e759f01

2 files changed

Lines changed: 21 additions & 21 deletions

File tree

.github/workflows/cd.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,42 +34,42 @@ jobs:
3434
virtualenvs-create: true
3535
virtualenvs-in-project: true
3636

37-
- name: "Bump pyproject.toml to new version"
37+
- name: "Bump pyproject.toml version"
3838
id: bump
3939
run: |
4040
poetry version ${{ github.event.inputs.release-type }}
4141
echo "::set-output name=version::$(poetry version --short)"
4242
43-
- name: "Bump apilytics.__version__ to new version"
43+
- name: "Bump `apilytics.__version__`"
4444
run: sed -i 's/^__version__ *=.*/__version__ = "${{ steps.bump.outputs.version }}"/' apilytics/__init__.py
4545

46-
- name: "Build the wheel"
47-
run: poetry build
48-
49-
- name: "Publish to PyPI"
50-
run: poetry publish
51-
env:
52-
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
53-
5446
- name: "Update the changelog"
5547
# Find the first line that starts with `###` or `## [<number>` from the CHANGELOG and insert the new version header before it.
56-
run: |
57-
current_date="$(date -u '+%Y-%m-%d')"
58-
sed -i "0,/^\(###\|## *\[[0-9]\).*/{s//## [${{ steps.bump.outputs.version }}] - ${current_date}\n\n&/}" CHANGELOG.md
48+
run: sed -i "0,/^\(###\|## *\[[0-9]\).*/{s//## [${{ steps.bump.outputs.version }}] - $(date -u '+%Y-%m-%d')\n\n&/}" CHANGELOG.md
5949

6050
- name: "Extract version's changelog for release notes"
6151
# 1. Find the lines between the first `## [<number>` and the second `## [<number>`.
6252
# 2. Remove all leading and trailing newlines from the output.
6353
run: sed '1,/^## *\[[0-9]/d;/^## *\[[0-9]/Q' CHANGELOG.md | sed -e :a -e '/./,$!d;/^\n*$/{$d;N;};/\n$/ba' > release_notes.txt
6454

6555
- name: "Commit and tag the changes"
66-
uses: EndBug/add-and-commit@8c12ff729a98cfbcd3fe38b49f55eceb98a5ec02 # v7.5.0
67-
with:
68-
add: '["pyproject.toml", "apilytics/__init__.py", "CHANGELOG.md"]'
69-
message: 'Release ${{ steps.bump.outputs.version }}'
70-
tag: 'v${{ steps.bump.outputs.version }} --annotate --file /dev/null'
71-
default_author: github_actions
72-
pathspec_error_handling: exitImmediately
56+
run: |
57+
git config user.name 'github-actions'
58+
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
59+
git add pyproject.toml apilytics/__init__.py CHANGELOG.md
60+
git commit --message='Release ${{ steps.bump.outputs.version }}'
61+
git tag --annotate --message='' v${{ steps.bump.outputs.version }}
62+
63+
- name: "Build the wheel"
64+
run: poetry build
65+
66+
- name: "Publish to PyPI"
67+
run: poetry publish
68+
env:
69+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
70+
71+
- name: "Push the changes"
72+
run: git push --follow-tags
7373

7474
- name: "Create a GitHub release"
7575
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 # v1

apilytics/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def set_response_info(
117117
Args:
118118
status_code: Status code for the HTTP response. Can be omitted (or None)
119119
if the middleware could not get the status code.
120-
response_size: Size of the body of the sent HTTP response in bytes.
120+
response_size: Size of the sent HTTP response's body in bytes.
121121
"""
122122
self._status_code = status_code
123123
self._response_size = response_size

0 commit comments

Comments
 (0)