-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:muhammedattif/Paymob
# Conflicts: # .github/workflows/publish.yml # README.md
- Loading branch information
Showing
32 changed files
with
2,741 additions
and
889 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
ACCEPT_API_KEY= | ||
ACCEPT_HMAC_SECRET= | ||
ACCEPT_APIS_TIMEOUT_SECONDES=10 | ||
SKIP_INTEGRATION_TESTS=True |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,65 @@ | ||
name: Publish to PyPI.org | ||
name: Publish Python 🐍 distributions 📦 to PyPI | ||
|
||
on: | ||
release: | ||
types: [published] | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
pypi: | ||
build-publish: | ||
name: Build and publish Python 🐍 distributions 📦 to PyPI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- run: python3 -m pip install --upgrade build && python3 -m build | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{pypi-AgEIcHlwaS5vcmcCJGMyYTNjNmU4LTFhMjYtNDYzMy04MGJiLTNiYmE5MmEzZjRjMwACKlszLCJjNTIyN2MxOC04ZDY3LTQyNjgtYTA4Ni02MDdhNjVmN2MzNDgiXQAABiCsyqwx0r7qiHCz0-po11RGqqFwvA5b-YuuhotH3Sef-g}} | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Install pypa/setuptools | ||
run: python -m pip install wheel | ||
|
||
- name: Extract tag name | ||
id: tag | ||
run: echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | cut -d / -f 3) | ||
|
||
- name: Determine new release version | ||
id: release-version | ||
if: github.ref == 'refs/heads/main' | ||
run: | | ||
current_version=${{ steps.tag.outputs.TAG_NAME }} | ||
IFS='.' read -ra version_parts <<< "$current_version" | ||
new_version="${version_parts[0]}.${version_parts[1]}.$((${version_parts[2]} + 1))" | ||
echo "::set-output name=NEW_RELEASE_VERSION::$new_version" | ||
- name: Update version in setup.py | ||
run: | | ||
if [[ -n "${{ steps.release-version.outputs.NEW_RELEASE_VERSION }}" ]]; then | ||
new_release_version="${{ steps.release-version.outputs.NEW_RELEASE_VERSION }}" | ||
sed -i "s/{{VERSION_PLACEHOLDER}}/${new_release_version}/g" setup.py | ||
else | ||
sed -i "s/{{VERSION_PLACEHOLDER}}/${{ steps.tag.outputs.TAG_NAME }}/g" setup.py | ||
fi | ||
- name: Build a binary wheel | ||
run: python setup.py sdist bdist_wheel | ||
|
||
- name: Publish package 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
|
||
- name: Adjust release tag | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
git config --local user.email "action@github.com" | ||
git config --local user.name "GitHub Action" | ||
git tag -d "${{ steps.tag.outputs.TAG_NAME }}" | ||
git push origin :refs/tags/${{ steps.tag.outputs.TAG_NAME }} | ||
git tag "${{ steps.tag.outputs.TAG_NAME }}" | ||
git push origin "${{ steps.tag.outputs.TAG_NAME }}" | ||
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
Oops, something went wrong.