appimage.yml 1.9 KB

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