cli_release.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. name: Build CLI for Release
  2. # Will run automatically on every new release
  3. on:
  4. release:
  5. types: [published]
  6. jobs:
  7. build-and-upload:
  8. permissions:
  9. contents: write
  10. runs-on: ${{ matrix.platform.os }}
  11. strategy:
  12. matrix:
  13. platform:
  14. - {
  15. target: x86_64-pc-windows-msvc,
  16. os: windows-latest,
  17. toolchain: "1.70.0",
  18. }
  19. - {
  20. target: x86_64-apple-darwin,
  21. os: macos-latest,
  22. toolchain: "1.70.0",
  23. }
  24. - {
  25. target: x86_64-unknown-linux-gnu,
  26. os: ubuntu-latest,
  27. toolchain: "1.70.0",
  28. }
  29. steps:
  30. - uses: actions/checkout@v4
  31. - name: Install stable
  32. uses: dtolnay/rust-toolchain@master
  33. with:
  34. toolchain: ${{ matrix.platform.toolchain }}
  35. targets: ${{ matrix.platform.target }}
  36. - uses: ilammy/setup-nasm@v1
  37. # Setup the Github Actions Cache for the CLI package
  38. - name: Setup cache
  39. uses: Swatinem/rust-cache@v2
  40. with:
  41. workspaces: packages/cli -> ../../target
  42. # This neat action can build and upload the binary in one go!
  43. - name: Build and upload binary
  44. uses: taiki-e/upload-rust-binary-action@v1
  45. with:
  46. token: ${{ secrets.GITHUB_TOKEN }}
  47. target: ${{ matrix.platform.target }}
  48. bin: dx
  49. archive: dx-${{ matrix.platform.target }}
  50. checksum: sha256
  51. manifest_path: packages/cli/Cargo.toml