cli_release.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. # Setup the Github Actions Cache for the CLI package
  37. - name: Setup cache
  38. uses: Swatinem/rust-cache@v2
  39. with:
  40. workspaces: packages/cli -> ../../target
  41. # This neat action can build and upload the binary in one go!
  42. - name: Build and upload binary
  43. uses: taiki-e/upload-rust-binary-action@v1
  44. with:
  45. token: ${{ secrets.GITHUB_TOKEN }}
  46. target: ${{ matrix.platform.target }}
  47. bin: dx
  48. archive: dx-${{ matrix.platform.target }}
  49. checksum: sha256
  50. manifest_path: packages/cli/Cargo.toml