Skip to content

Commit

Permalink
Test deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
adang1345 committed Nov 18, 2024
1 parent c97141e commit dd46642
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 50 deletions.
111 changes: 62 additions & 49 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ env:
jobs:
build_windows:
runs-on: windows-2022
outputs:
DEPLOY: ${{ steps.build-and-install.DEPLOY }}
steps:
- name: check out repository
uses: actions/checkout@v4
Expand All @@ -30,68 +32,79 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.12'
# - name: find instances of msvcp140.dll
# working-directory: ${{ github.workspace }}
# run: |
# pip install pefile
# python scripts\find_library.py
# - name: find instances of msvcp140.dll
# working-directory: ${{ github.workspace }}
# run: |
# pip install pefile
# python scripts\find_library.py
- name: build and install
id: build-and-install
working-directory: ${{ github.workspace }}
run: |
pip install build
python -m build
pip install $(Get-ChildItem dist\delvewheel-*.whl)
if ((git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | Out-String).Contains("delvewheel/_version.py`r`n")) {
echo VERSION_CHANGED=1 | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo VERSION_CHANGED=1 | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
}
- name: upload build artifacts
uses: actions/upload-artifact@v4
with:
name: delvewheel
path: ${{ github.workspace }}\dist\*
compression-level: 0
- name: run tests with Python 3.12
working-directory: ${{ github.workspace }}\tests
run: |
pip install setuptools
python run_tests.py -v
- name: set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: run tests with Python 3.8
working-directory: ${{ github.workspace }}\tests
run: |
pip install wheel
pip install $(Get-ChildItem ..\dist\delvewheel-*.whl)
python run_tests.py -v Python38TestCase
- name: set up PyPy3.10
uses: actions/setup-python@v5
with:
python-version: 'pypy3.10'
- name: run tests with PyPy3.10
working-directory: ${{ github.workspace }}\tests
run: |
pip install wheel
pip install $(Get-ChildItem ..\dist\delvewheel-*.whl)
python run_tests.py -v PyPyTestCase
- name: set up Ubuntu 24.04
uses: Vampire/setup-wsl@v3
# - name: run tests with Python 3.12
# working-directory: ${{ github.workspace }}\tests
# run: |
# pip install setuptools
# python run_tests.py -v
# - name: set up Python 3.8
# uses: actions/setup-python@v5
# with:
# python-version: '3.8'
# - name: run tests with Python 3.8
# working-directory: ${{ github.workspace }}\tests
# run: |
# pip install wheel
# pip install $(Get-ChildItem ..\dist\delvewheel-*.whl)
# python run_tests.py -v Python38TestCase
# - name: set up PyPy3.10
# uses: actions/setup-python@v5
# with:
# python-version: 'pypy3.10'
# - name: run tests with PyPy3.10
# working-directory: ${{ github.workspace }}\tests
# run: |
# pip install wheel
# pip install $(Get-ChildItem ..\dist\delvewheel-*.whl)
# python run_tests.py -v PyPyTestCase
# - name: set up Ubuntu 24.04
# uses: Vampire/setup-wsl@v3
# with:
# distribution: Ubuntu-24.04
# additional-packages: python-is-python3 python3-pip python3-wheel python3-venv
# - name: run tests on Ubuntu 24.04
# working-directory: ${{ github.workspace }}\tests
# shell: wsl-bash {0}
# run: |
# export PIP_CACHE_DIR=$(wslpath '${{ env.PIP_CACHE_DIR }}')
# python -m venv venv
# source venv/bin/activate
# pip install ../dist/delvewheel-*.whl
# python run_tests.py -v LinuxTestCase
deploy:
needs: build_windows
if: needs.build_windows.outputs.DEPLOY == '1' && github.event_name == 'push' && github.repository_owner == 'adang1345'
name: Deploy to PyPI
runs-on: ubuntu-24.04
permissions:
id-token: write
steps:
- name: download build artifacts
uses: actions/download-artifact@v4
with:
distribution: Ubuntu-24.04
additional-packages: python-is-python3 python3-pip python3-wheel python3-venv
- name: run tests on Ubuntu 24.04
working-directory: ${{ github.workspace }}\tests
shell: wsl-bash {0}
run: |
export PIP_CACHE_DIR=$(wslpath '${{ env.PIP_CACHE_DIR }}')
python -m venv venv
source venv/bin/activate
pip install ../dist/delvewheel-*.whl
python run_tests.py -v LinuxTestCase
name: delvewheel
- name: deploy
if: env.VERSION_CHANGED == '1' && github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'adang1345'
working-directory: ${{ github.workspace }}
run: |
pip install twine
twine upload --skip-existing -u __token__ -p ${{ secrets.PYPI_TOKEN }} dist\*
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
2 changes: 1 addition & 1 deletion delvewheel/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.9.0'
__version__ = '1.9.0.dev0'

0 comments on commit dd46642

Please sign in to comment.