release.yml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. on:
  2. push:
  3. tags:
  4. - 'v*.*'
  5. name: Release
  6. jobs:
  7. build-ubuntu:
  8. runs-on: ubuntu-20.04
  9. steps:
  10. - uses: actions/checkout@v2
  11. - name: Set environment variables
  12. id: vars
  13. run: |
  14. echo "::set-output name=ref::$(echo ${{ github.ref }} | sed -e's#.*/##')"
  15. - name: Dependency packages (apt)
  16. run: |
  17. sudo apt update
  18. sudo apt -y install git gcc-arm-none-eabi python3-pip srecord stm32flash zip
  19. - name: Dependency packages (pip)
  20. run: python3 -m pip install --user bitarray crcmod pyserial
  21. - name: Build dist
  22. run: make dist
  23. - name: Upload artifacts
  24. uses: actions/upload-artifact@v2
  25. with:
  26. name: Greaseweazle.CI.${{ steps.vars.outputs.ref }}
  27. path: Greaseweazle-${{ steps.vars.outputs.ref }}.zip
  28. build-windows:
  29. needs: build-ubuntu
  30. runs-on: windows-2019
  31. steps:
  32. - uses: actions/checkout@v2
  33. - name: Set environment variables
  34. id: vars
  35. run: |
  36. echo "::set-output name=ref::$(echo ${{ github.ref }} | sed -e's#.*/##')"
  37. - name: Download Ubuntu build
  38. uses: actions/download-artifact@v2
  39. with:
  40. name: Greaseweazle.CI.${{ steps.vars.outputs.ref }}
  41. - name: Set up Python
  42. uses: actions/setup-python@v2
  43. with:
  44. python-version: 3.8
  45. architecture: x86
  46. - name: Dependency packages (pip)
  47. run: |
  48. python -m pip install --upgrade pip setuptools wheel
  49. python -m pip install --user bitarray crcmod pyserial cx_Freeze
  50. - name: Build dist
  51. run: make windist
  52. - name: Upload artifacts
  53. uses: actions/upload-artifact@v2
  54. with:
  55. name: Greaseweazle.CI.${{ steps.vars.outputs.ref }}
  56. path: Greaseweazle-${{ steps.vars.outputs.ref }}-win.zip
  57. finalise:
  58. needs: build-windows
  59. runs-on: ubuntu-20.04
  60. steps:
  61. - uses: actions/checkout@v2
  62. - name: Set environment variables
  63. id: vars
  64. run: |
  65. echo "::set-output name=ref::$(echo ${{ github.ref }} | sed -e's#.*/##')"
  66. - name: Download artifacts
  67. uses: actions/download-artifact@v2
  68. with:
  69. name: Greaseweazle.CI.${{ steps.vars.outputs.ref }}
  70. - name: Remove 64-bit DLLS
  71. run: |
  72. export VER=${{ steps.vars.outputs.ref }}
  73. unzip Greaseweazle-$VER-win.zip
  74. find . -name 'api-ms-win-crt-*' | xargs rm
  75. find Greaseweazle-$VER/lib -name 'python*.dll' | xargs rm
  76. find Greaseweazle-$VER/lib -name 'vcruntime140.dll' | xargs rm
  77. rm Greaseweazle-$VER-win.zip
  78. zip -r Greaseweazle-$VER-win.zip Greaseweazle-$VER
  79. - name: Create Release
  80. id: create_release
  81. uses: actions/create-release@v1
  82. env:
  83. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  84. with:
  85. tag_name: ${{ github.ref }}
  86. release_name: ${{ steps.vars.outputs.ref }}
  87. body: "[**Release Notes:**](https://github.com/keirf/Greaseweazle/blob/master/RELEASE_NOTES)"
  88. draft: false
  89. prerelease: false
  90. - name: Upload Release Asset (Windows)
  91. uses: actions/upload-release-asset@v1
  92. env:
  93. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  94. with:
  95. upload_url: ${{ steps.create_release.outputs.upload_url }}
  96. asset_path: Greaseweazle-${{ steps.vars.outputs.ref }}-win.zip
  97. asset_name: Greaseweazle-${{ steps.vars.outputs.ref }}-win.zip
  98. asset_content_type: application/zip
  99. - name: Upload Release Asset (Other)
  100. uses: actions/upload-release-asset@v1
  101. env:
  102. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  103. with:
  104. upload_url: ${{ steps.create_release.outputs.upload_url }}
  105. asset_path: Greaseweazle-${{ steps.vars.outputs.ref }}.zip
  106. asset_name: Greaseweazle-${{ steps.vars.outputs.ref }}.zip
  107. asset_content_type: application/zip