Skip to content

Commit

Permalink
ci: migrate Windows from appveyor to GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Nov 3, 2023
1 parent 4ac2c49 commit e39a193
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 131 deletions.
86 changes: 0 additions & 86 deletions .appveyor.yml

This file was deleted.

8 changes: 5 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
python-version: ['3.10']
os: [macos-latest, ubuntu-latest]
os: [macos-latest, ubuntu-latest, windows-latest]
env:
# Display must be available globally for linux to know where xvfb is
DISPLAY: :0
Expand All @@ -28,7 +28,6 @@ jobs:
- name: Setup xvfb (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0
# start xvfb in the background
sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 &
Expand All @@ -45,8 +44,11 @@ jobs:
# show information for rpy2
python -m rpy2.situation
- name: Start application and print version
env:
# Display must be available globally for linux to know where xvfb is
QT_DEBUG_PLUGINS: 1
run: |
QT_DEBUG_PLUGINS=1 python -m shapeout2 --version
python -m shapeout2 --version
- name: Test with pytest
env:
# github token required for testing update.py
Expand Down
66 changes: 29 additions & 37 deletions .github/workflows/deploy_github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,51 @@ 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
- uses: actions/checkout@v3
- name: Set up Python
- name: Set up Python ${{ matrix.python-version }}
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
pip install -e .
- name: Build macOS app
if: runner.os == 'macOS'
working-directory: ./build-recipes
run: |
# Uninstall rpy2, because it does not work on frozen macOS:
# https://github.com/ZELLMECHANIK-DRESDEN/ShapeOut2/issues/73
pip uninstall -y rpy2
- name: Build app
bash ./macos_build_app.sh ShapeOut2 ${{ env.RELEASE_VERSION }}
- name: Build windows executable
if: runner.os == 'windows'
working-directory: ./build-recipes
run: |
bash ./macos_build_app.sh ShapeOut2 ${{ 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
pip install -r win_build_requirements.txt
pyinstaller -y --log-level=WARN win_ShapeOut2.spec
# Run the binary (the most simple test)
dist\\ShapeOut2\\ShapeOut2.exe --version
python win_make_iss.py
ISCC.exe /Q win_shapeout2.iss
- name: Release Assets
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Shape-Out ${{ github.ref }}
body: |
![](https://img.shields.io/github/downloads/ZELLMECHANIK-DRESDEN/ShapeOut2/${{ env.RELEASE_VERSION }}/total.svg)
See https://shapeout2.readthedocs.io/en/stable/sec_changelog.html for
a list of changes made in this release.
name: ShapeOut ${{ 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/ShapeOut2_${{ env.RELEASE_VERSION }}.dmg
asset_name: ShapeOut2_${{ 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/ShapeOut2.pkg
asset_name: ShapeOut2.pkg
asset_content_type: application/zip
body: |
![](https://img.shields.io/github/downloads/ZELLMECHANIK-DRESDEN/ShapeOut2/${{ env.RELEASE_VERSION }}/total.svg)
files: |
./build-recipes/dist/*.dmg
./build-recipes/dist/*.pkg
./build-recipes/Output/*.exe
2 changes: 1 addition & 1 deletion .github/workflows/deploy_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
deploy:

runs-on: macos-latest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
Expand Down
6 changes: 2 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
|ShapeOut2|
===========

|PyPI Version| |Build Status Unix| |Build Status Win| |Coverage Status| |Docs Status|
|PyPI Version| |Build Status| |Coverage Status| |Docs Status|


**Shape-Out 2** is the successor of
Expand Down Expand Up @@ -61,10 +61,8 @@ Testing
.. |ShapeOut2| image:: https://raw.github.com/ZELLMECHANIK-DRESDEN/ShapeOut2/master/docs/logo/shapeout2_h50.png
.. |PyPI Version| image:: https://img.shields.io/pypi/v/ShapeOut2.svg
:target: https://pypi.python.org/pypi/ShapeOut2
.. |Build Status Unix| image:: https://img.shields.io/github/actions/workflow/status/ZELLMECHANIK-DRESDEN/ShapeOut2/check.yml?branch=master
.. |Build Status| image:: https://img.shields.io/github/actions/workflow/status/ZELLMECHANIK-DRESDEN/ShapeOut2/check.yml?branch=master
:target: https://github.com/ZELLMECHANIK-DRESDEN/ShapeOut2/actions?query=workflow%3AChecks
.. |Build Status Win| image:: https://img.shields.io/appveyor/build/paulmueller/shapeout2
:target: https://ci.appveyor.com/project/paulmueller/ShapeOut2
.. |Coverage Status| image:: https://img.shields.io/codecov/c/github/ZELLMECHANIK-DRESDEN/ShapeOut2/master.svg
:target: https://codecov.io/gh/ZELLMECHANIK-DRESDEN/ShapeOut2
.. |Docs Status| image:: https://img.shields.io/readthedocs/shapeout2
Expand Down

0 comments on commit e39a193

Please sign in to comment.