appimage.yml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. name: AppImage
  2. on:
  3. push:
  4. paths:
  5. - '.github/workflows/appimage.yml'
  6. - 'python_appimage/**'
  7. schedule:
  8. - cron: '0 3 * * 0'
  9. jobs:
  10. Build:
  11. runs-on: ubuntu-latest
  12. strategy:
  13. matrix:
  14. image: ['1', '2010', '2014']
  15. arch: [x86_64, i686]
  16. tag: [cp27-cp27m, cp27-cp27mu, cp35-cp35m, cp36-cp36m, cp37-cp37m,
  17. cp38-cp38, cp39-cp39]
  18. exclude:
  19. - image: '2010'
  20. tag: cp39-cp39
  21. - image: '2014'
  22. tag: cp27-cp27m
  23. - image: '2014'
  24. tag: cp27-cp27mu
  25. - image: '2014'
  26. tag: cp39-cp39
  27. steps:
  28. - uses: actions/checkout@v2
  29. - name: Build
  30. env:
  31. ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
  32. run: |
  33. # Build the AppImage
  34. python -m python_appimage build manylinux \
  35. ${{ matrix.image }}_${{ matrix.arch }} \
  36. ${{ matrix.tag }}
  37. # Export the AppImage name and the Python version
  38. appimage=$(ls python*.AppImage)
  39. SCRIPT=$(cat <<-END
  40. version = '${appimage}'[6:].split('.', 2)
  41. print('{:}.{:}'.format(*version[:2]))
  42. END
  43. )
  44. version=$(python -c "${SCRIPT}")
  45. echo "::set-env name=PYTHON_APPIMAGE::${appimage}"
  46. echo "::set-env name=PYTHON_VERSION::${version}"
  47. - uses: actions/upload-artifact@v1
  48. if: github.ref == 'refs/heads/master'
  49. with:
  50. name: python${{ env.PYTHON_VERSION }}-appimages
  51. path: ${{ env.PYTHON_APPIMAGE }}
  52. Release:
  53. needs: Build
  54. runs-on: ubuntu-latest
  55. if: github.ref == 'refs/heads/master'
  56. strategy:
  57. matrix:
  58. version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
  59. steps:
  60. - uses: actions/download-artifact@v1
  61. with:
  62. name: python${{ matrix.version }}-appimages
  63. - name: Release
  64. uses: marvinpinto/action-automatic-releases@latest
  65. with:
  66. automatic_release_tag: python${{ matrix.version }}
  67. title: Python ${{ matrix.version }}
  68. files: |
  69. python${{ matrix.version }}-appimages/python*.AppImage
  70. repo_token: ${{ secrets.GITHUB_TOKEN }}