From 996fd1a833918fd0fcfa9038295c2944694cfab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20M=C3=BCller?= Date: Mon, 30 Oct 2023 15:16:45 +0100 Subject: [PATCH] ci: migrate from appveyor to GitHub Actions --- .appveyor.yml | 82 ----------------------------- .github/workflows/deploy_github.yml | 60 ++++++++++----------- CHANGELOG | 1 + README.rst | 6 +-- 4 files changed, 30 insertions(+), 119 deletions(-) delete mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 1d681f3..0000000 --- a/.appveyor.yml +++ /dev/null @@ -1,82 +0,0 @@ -# Use large clone depth so that a tag is included for versioning -clone_depth: 256 -image: Visual Studio 2019 - -notifications: - - provider: Email - on_build_success: false - on_build_failure: false - on_build_status_changed: false - -environment: - matrix: - - PYTHON: "C:\\Python310-x64" - DCOR_API_KEY: - secure: fZWCZrKoGp2a/bNqd+quJRsVcRI5Jx774LLx3BX3jDuFAqHEAkGR3M/Wq7IwxXua - -init: - - ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH% - -install: - # Install InnoSetup and add to path - - appveyor-retry choco install -y InnoSetup - # Prepend newly installed Python to the PATH of this build (this cannot be - # done from inside the powershell script as it would require to restart - # the parent CMD process). - - set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH% - # Check that we have the expected version and architecture for Python - - python --version - # Install dcoraid and its dependencies - - appveyor-retry python -m pip install --upgrade pip wheel - # install build requirements (pinned versions of some packages) - - python -m pip install -r tests\\requirements.txt - - python -m pip install -r build-recipes\\win_build_requirements.txt - # Install package - - appveyor-retry pip install -e .[GUI] - # Show the installed packages - - pip freeze - -build: off - -test_script: - - python -c "import dcoraid; print(dcoraid.__version__)" - - pip install coverage - - pip install pytest pytest-qt - - python -m coverage run --source=dcoraid -m pytest tests --ignore tests/test_gui.py -x - # sometimes GUI tests fail due to threading issues - - python -m coverage run --source=dcoraid -m pytest tests/test_gui.py -x || exit 0 - # check if pytest wrote failures to the "pytest-failures.txt" file - # (exits 0 if the file does not exist) - - if exist pytest-failures.txt exit 1 - - python -m coverage report -m - -after_test: - - appveyor-retry pip install twine wheel - # If tests are successful, create a whl package for the project. - - python setup.py bdist_wheel - - python setup.py sdist - - ps: "ls dist" - # Run pyinstaller - - cd build-recipes - - pyinstaller -y --log-level=WARN win_DCOR-Aid.spec - # Run the binary (the most simple test) - - dist\\DCOR-Aid\\DCOR-Aid.exe --version - # Create InnoSetup installers - # Generate iss file - - python win_make_iss.py - # Set InnoSetup path here, because Cython complained about it. - - set PATH=%PATH%;"C:\\Program Files (x86)\\Inno Setup 5" - - iscc /Q win_dcoraid.iss - -artifacts: - # InnoSetup files - - path: build-recipes\Output\* - -deploy: - provider: GitHub - auth_token: - secure: u94ePbzUmuyh5jZU+1xvST73Ueuxepu86/XQsGx/15AnSd4NhQHKE1UXIe1vBIwf - artifact: /.*\.exe/ - draft: true - on: - appveyor_repo_tag: true # deploy on tag push only diff --git a/.github/workflows/deploy_github.yml b/.github/workflows/deploy_github.yml index 30ce723..3b70369 100644 --- a/.github/workflows/deploy_github.yml +++ b/.github/workflows/deploy_github.yml @@ -8,7 +8,11 @@ on: jobs: build: name: Create Release - runs-on: macos-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: ["3.10"] + os: [macos-latest, windows-latest] steps: - name: Set env run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV @@ -16,47 +20,37 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip pip install setuptools wheel twine # install our patched version of pyqtgraph pip install -e .[GUI] - - name: Build app + - name: Build macOS app + if: runner.os == 'macOS' working-directory: ./build-recipes run: | bash ./macos_build_app.sh DCOR-Aid ${{ env.RELEASE_VERSION }} - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + - name: Build windows executable + if: runner.os == 'windows' + working-directory: ./build-recipes + run: | + pip install -r win_build_requirements.txt + pyinstaller -y --log-level=WARN win_DCOR-Aid.spec + # Run the binary (the most simple test) + dist\\DCOR-Aid\\DCOR-Aid.exe --version + python win_make_iss.py + ISCC.exe /Q win_dckit.iss + - name: Release Assets + uses: softprops/action-gh-release@v1 with: - tag_name: ${{ github.ref }} - release_name: DCOR-Aid ${{ github.ref }} - body: | - ![](https://img.shields.io/github/downloads/DCOR-dev/DCOR-Aid/${{ env.RELEASE_VERSION }}/total.svg) - + name: DCOR-Aid ${{ env.RELEASE_VERSION }} draft: true prerelease: false - - name: Upload Release Asset DMG - id: upload-release-asset-dmg - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: ./build-recipes/dist/DCOR-Aid_${{ env.RELEASE_VERSION }}.dmg - asset_name: DCOR-Aid_${{ env.RELEASE_VERSION }}.dmg - asset_content_type: application/zip - - name: Upload Release Asset PGK - id: upload-release-asset-pkg - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: ./build-recipes/dist/DCOR-Aid.pkg - asset_name: DCOR-Aid.pkg - asset_content_type: application/zip + body: | + ![](https://img.shields.io/github/downloads/DCOR-dev/DCOR-Aid/${{ env.RELEASE_VERSION }}/total.svg) + files: | + ./build-recipes/dist/*.dmg + ./build-recipes/dist/*.pkg + ./build-recipes/Output/*.exe diff --git a/CHANGELOG b/CHANGELOG index 3fcdd7f..6b98510 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ 0.13.0 - setup: drop support for Python 3.9 + - ci: migrate from appveyor to GitHub Actions 0.12.9 - fix: twisted error message upon SHA-256 upload verification (#73) - fix: user_show raised unexpected APINotFoundError in wizard diff --git a/README.rst b/README.rst index 5747e77..08ff5f4 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ |DCOR-Aid| ========== -|PyPI Version| |Build Status Unix| |Tests Status Win| |Coverage Status| +|PyPI Version| |Build Status| |Coverage Status| DCOR-Aid is a GUI for managing data on DCOR (https://dcor.mpl.mpg.de). @@ -35,9 +35,7 @@ By default, testing is done with https://dcor-dev.mpl.mpg.de and the user .. |DCOR-Aid| image:: https://raw.github.com/DCOR-dev/DCOR-Aid/master/dcoraid/img/dcoraid_text.png .. |PyPI Version| image:: https://img.shields.io/pypi/v/dcoraid.svg :target: https://pypi.python.org/pypi/DCOR-Aid -.. |Build Status Unix| image:: https://img.shields.io/github/actions/workflow/status/DCOR-dev/DCOR-Aid/check.yml +.. |Build Status| image:: https://img.shields.io/github/actions/workflow/status/DCOR-dev/DCOR-Aid/check.yml :target: https://github.com/DCOR-dev/DCOR-Aid/actions?query=workflow%3AChecks -.. |Tests Status Win| image:: https://img.shields.io/appveyor/ci/paulmueller/DCOR-Aid/master.svg?label=tests_win - :target: https://ci.appveyor.com/project/paulmueller/DCOR-Aid .. |Coverage Status| image:: https://img.shields.io/codecov/c/github/DCOR-dev/DCOR-Aid/master.svg :target: https://codecov.io/gh/DCOR-dev/DCOR-Aid