appimage.yml 2.3 KB

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