release.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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=ver::$(echo ${{ github.ref }} | sed -e's#.*/v##')"
  15. - name: Dependency packages (apt)
  16. run: |
  17. sudo apt update
  18. sudo apt -y install git gcc-arm-none-eabi python3-pip srecord zip
  19. - name: Dependency packages (pip)
  20. run: python3 -m pip install --user crcmod
  21. - name: Build dist
  22. run: |
  23. make -j4 dist
  24. mv out/*.zip .
  25. - name: Upload artifacts
  26. uses: actions/upload-artifact@v2
  27. with:
  28. name: greaseweazle-firmware.ci.${{ steps.vars.outputs.ver }}
  29. path: greaseweazle-firmware-${{ steps.vars.outputs.ver }}.zip
  30. finalise:
  31. needs: build-ubuntu
  32. runs-on: ubuntu-20.04
  33. steps:
  34. - uses: actions/checkout@v2
  35. - name: Set environment variables
  36. id: vars
  37. run: |
  38. echo "::set-output name=ver::$(echo ${{ github.ref }} | sed -e's#.*/v##')"
  39. - name: Download artifacts
  40. uses: actions/download-artifact@v2
  41. with:
  42. name: greaseweazle-firmware.ci.${{ steps.vars.outputs.ver }}
  43. - name: Create Release
  44. id: create_release
  45. uses: actions/create-release@v1
  46. env:
  47. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  48. with:
  49. tag_name: ${{ github.ref }}
  50. release_name: Greaseweazle Firmware ${{ steps.vars.outputs.ver }}
  51. body: "[**Release Notes:**](https://github.com/keirf/greaseweazle-firmware/blob/master/RELEASE_NOTES)"
  52. draft: false
  53. prerelease: false
  54. - name: Upload Release Asset
  55. uses: actions/upload-release-asset@v1
  56. env:
  57. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  58. with:
  59. upload_url: ${{ steps.create_release.outputs.upload_url }}
  60. asset_path: greaseweazle-firmware-${{ steps.vars.outputs.ver }}.zip
  61. asset_name: greaseweazle-firmware-${{ steps.vars.outputs.ver }}.zip
  62. asset_content_type: application/zip