appimage.yml 2.8 KB

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