release.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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-firmware.ci.${{ steps.vars.outputs.ref }}
  27. path: greaseweazle-firmware-${{ steps.vars.outputs.ref }}.zip
  28. finalise:
  29. needs: build-ubuntu
  30. runs-on: ubuntu-20.04
  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 artifacts
  38. uses: actions/download-artifact@v2
  39. with:
  40. name: greaseweazle-firmware.ci.${{ steps.vars.outputs.ref }}
  41. - name: Create Release
  42. id: create_release
  43. uses: actions/create-release@v1
  44. env:
  45. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  46. with:
  47. tag_name: ${{ github.ref }}
  48. release_name: Greaseweazle Firmware ${{ steps.vars.outputs.ref }}
  49. body: "[**Release Notes:**](https://github.com/keirf/greaseweazle-firmware/blob/master/RELEASE_NOTES)"
  50. draft: false
  51. prerelease: false
  52. - name: Upload Release Asset
  53. uses: actions/upload-release-asset@v1
  54. env:
  55. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  56. with:
  57. upload_url: ${{ steps.create_release.outputs.upload_url }}
  58. asset_path: greaseweazle-firmware-${{ steps.vars.outputs.ref }}.zip
  59. asset_name: greaseweazle-firmware-${{ steps.vars.outputs.ref }}.zip
  60. asset_content_type: application/zip