Skip to content

Commit

Permalink
Fix test, CHANGELOG and improve CI
Browse files Browse the repository at this point in the history
  • Loading branch information
dvacca-onfido committed Jun 13, 2024
1 parent d7ad424 commit 3d5751d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ jobs:
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_ACTION_ACCESS_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand All @@ -87,3 +89,31 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Update CHANGELOG.md
run: |
TMP_FILE=$(mktemp)
RELEASE_VERSION=$(jq -r '.release' .release.json)
RELEASE_DATE=`date +'%dth %B %Y' | sed -E 's/^0//;s/^([2,3]?)1th/\11st/;s/^([2]?)2th/\12nd/;s/^([2]?)3th/\13rd/'`
SPEC_COMMIT_SHA=$(jq -r '.source.short_sha' .release.json)
SPEC_COMMIT_URL=$(jq -r '.source.repo_url + "/commit/" + .source.long_sha' .release.json)
SPEC_RELEASE_VERSION=$(jq -r '.source.version' .release.json)
SPEC_RELEASE_URL=$(jq -r '.source.repo_url + "/releases/tag/" + .source.version' .release.json)
echo -e "# Changelog\n\n## $RELEASE_VERSION $RELEASE_DATE\n\n" >| $TMP_FILE
echo -en "${{ github.event.release.body }}\nBased on Onfido OpenAPI spec " >> $TMP_FILE
if [ -z $SPEC_RELEASE_VERSION ]; then
echo "up to commit [$SPEC_COMMIT_SHA](${SPEC_COMMIT_URL})." >> $TMP_FILE
else
echo "version [$SPEC_RELEASE_VERSION](${SPEC_RELEASE_URL})." >> $TMP_FILE
fi
grep -v "^# Changelog" CHANGELOG.md >> $TMP_FILE
mv $TMP_FILE CHANGELOG.md
git config user.name "GitHub Actions Bot"
git config user.email "<>"
git commit -m "Update CHANGELOG.md after library release" CHANGELOG.md
git push
5 changes: 0 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# Changelog

## v3.0.0 14th Jun 2024

- Make library auto-generated and based on [Onfido OpenAPI spec](https://github.com/onfido/onfido-openapi-spec)
- Refresh library up to commit: [62dc554](https://github.com/onfido/onfido-openapi-spec/commit/62dc5541a4a51e8de313fc99fb3dec496033a23e)

## v2.10.0 24th November 2023

- Added core methods for [WorkflowRuns](https://documentation.onfido.com/#workflow-runs)
Expand Down
1 change: 1 addition & 0 deletions tests/test_report_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@ def test_schema_of_facial_similarity_report_id_valid(
onfido_api.find_report, [facial_similarity_report_id], ReportStatus.COMPLETE
)
assert isinstance(facial_similarity_report, FacialSimilarityPhotoReport)
assert facial_similarity_report.properties.score is None

0 comments on commit 3d5751d

Please sign in to comment.