appimage.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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, cp310-cp310]
  18. exclude:
  19. - image: '1'
  20. tag: cp310-cp310
  21. - image: '2010'
  22. tag: cp27-cp27m
  23. - image: '2010'
  24. tag: cp27-cp27mu
  25. - image: '2010'
  26. tag: cp35-cp35m
  27. - image: '2014'
  28. tag: cp27-cp27m
  29. - image: '2014'
  30. tag: cp27-cp27mu
  31. - image: '2014'
  32. tag: cp35-cp35m
  33. steps:
  34. - uses: actions/checkout@v2
  35. - name: Build
  36. env:
  37. ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
  38. run: |
  39. # Build the AppImage
  40. python -m python_appimage build manylinux \
  41. ${{ matrix.image }}_${{ matrix.arch }} \
  42. ${{ matrix.tag }}
  43. # Export the AppImage name and the Python version
  44. appimage=$(ls python*.AppImage)
  45. SCRIPT=$(cat <<-END
  46. version = '${appimage}'[6:].split('.', 2)
  47. print('{:}.{:}'.format(*version[:2]))
  48. END
  49. )
  50. version=$(python -c "${SCRIPT}")
  51. echo "::set-env name=PYTHON_APPIMAGE::${appimage}"
  52. echo "::set-env name=PYTHON_VERSION::${version}"
  53. - uses: actions/upload-artifact@v1
  54. if: github.ref == 'refs/heads/master'
  55. with:
  56. name: python${{ env.PYTHON_VERSION }}-appimages
  57. path: ${{ env.PYTHON_APPIMAGE }}
  58. Release:
  59. needs: Build
  60. runs-on: ubuntu-latest
  61. if: github.ref == 'refs/heads/master'
  62. strategy:
  63. matrix:
  64. version: ['2.7', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10']
  65. steps:
  66. - uses: actions/download-artifact@v1
  67. with:
  68. name: python${{ matrix.version }}-appimages
  69. - name: Release
  70. uses: marvinpinto/action-automatic-releases@latest
  71. with:
  72. automatic_release_tag: python${{ matrix.version }}
  73. title: Python ${{ matrix.version }}
  74. files: |
  75. python${{ matrix.version }}-appimages/python*.AppImage
  76. repo_token: ${{ secrets.GITHUB_TOKEN }}