appimage.yml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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, 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. steps:
  40. - uses: actions/checkout@v2
  41. - name: Build
  42. env:
  43. ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
  44. run: |
  45. # Build the AppImage
  46. python -m python_appimage build manylinux \
  47. ${{ matrix.image }}_${{ matrix.arch }} \
  48. ${{ matrix.tag }}
  49. # Export the AppImage name and the Python version
  50. appimage=$(ls python*.AppImage)
  51. SCRIPT=$(cat <<-END
  52. version = '${appimage}'[6:].split('.', 2)
  53. print('{:}.{:}'.format(*version[:2]))
  54. END
  55. )
  56. version=$(python -c "${SCRIPT}")
  57. echo "::set-env name=PYTHON_APPIMAGE::${appimage}"
  58. echo "::set-env name=PYTHON_VERSION::${version}"
  59. - uses: actions/upload-artifact@v1
  60. if: github.ref == 'refs/heads/master'
  61. with:
  62. name: python${{ env.PYTHON_VERSION }}-appimages
  63. path: ${{ env.PYTHON_APPIMAGE }}
  64. Release:
  65. needs: Build
  66. runs-on: ubuntu-latest
  67. if: github.ref == 'refs/heads/master'
  68. strategy:
  69. matrix:
  70. version: ['2.7', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
  71. steps:
  72. - uses: actions/download-artifact@v1
  73. with:
  74. name: python${{ matrix.version }}-appimages
  75. - name: Release
  76. uses: marvinpinto/action-automatic-releases@latest
  77. with:
  78. automatic_release_tag: python${{ matrix.version }}
  79. title: Python ${{ matrix.version }}
  80. files: |
  81. python${{ matrix.version }}-appimages/python*.AppImage
  82. repo_token: ${{ secrets.GITHUB_TOKEN }}