cli.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. name: Build and Upload Binaries
  2. on:
  3. push:
  4. branches: ["main"]
  5. permissions:
  6. contents: write
  7. env:
  8. CARGO_TERM_COLOR: always
  9. RELEASE_TAG: v1.1.0
  10. jobs:
  11. create_release:
  12. runs-on: ubuntu-latest
  13. outputs:
  14. upload_url: ${{ steps.create_release.outputs.upload_url }}
  15. release_id: ${{ steps.create_release.outputs.id }}
  16. steps:
  17. - uses: actions/checkout@v3
  18. with:
  19. fetch-depth: 0
  20. - name: Create GitHub Release
  21. id: create_release
  22. uses: zendesk/action-create-release@v1
  23. env:
  24. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  25. with:
  26. auto_increment_type: patch
  27. prerelease: false
  28. draft: false
  29. tag_schema: semantic
  30. build:
  31. needs: create_release
  32. runs-on: ${{ matrix.os }}
  33. strategy:
  34. matrix:
  35. os: [ubuntu-latest, ubuntu-24.04-arm, macos-13, macos-latest, windows-latest]
  36. include:
  37. - os: ubuntu-latest
  38. target: x86_64-unknown-linux-gnu
  39. binary_name: helix-cli-linux-amd64
  40. - os: ubuntu-24.04-arm
  41. target: aarch64-unknown-linux-gnu
  42. binary_name: helix-cli-linux-arm64
  43. - os: macos-13
  44. target: x86_64-apple-darwin
  45. binary_name: helix-cli-macos-amd64
  46. - os: macos-latest
  47. target: aarch64-apple-darwin
  48. binary_name: helix-cli-macos-arm64
  49. - os: windows-latest
  50. target: x86_64-pc-windows-msvc
  51. binary_name: helix-cli-windows-amd64.exe
  52. steps:
  53. - uses: actions/checkout@v3
  54. - name: Install OpenSSL, pkg-config, and GCC (Linux only)
  55. if: matrix.os == 'ubuntu-20.04'
  56. run: |
  57. sudo apt-get update
  58. sudo apt-get install -y libssl-dev pkg-config gcc
  59. - name: Set up Rust
  60. uses: actions-rs/toolchain@v1
  61. with:
  62. profile: minimal
  63. toolchain: stable
  64. target: ${{ matrix.target }}
  65. override: true
  66. - name: Build
  67. run: |
  68. cd helix-cli
  69. cargo build --release --target ${{ matrix.target }}
  70. - name: Upload Release Asset
  71. uses: actions/upload-release-asset@v1
  72. with:
  73. upload_url: ${{ needs.create_release.outputs.upload_url }}
  74. asset_path: target/${{ matrix.target }}/release/${{ matrix.os == 'windows-latest' && 'helix.exe' || 'helix' }}
  75. asset_name: ${{ matrix.binary_name }}
  76. asset_content_type: application/octet-stream
  77. env:
  78. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}