publish-rust.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. name: Publish Rust Crate
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. package-path:
  6. description: Path to directory with package to release
  7. required: true
  8. default: 'clients/cli'
  9. type: choice
  10. options:
  11. - clients/cli
  12. - interface
  13. - program
  14. level:
  15. description: Level
  16. required: true
  17. default: patch
  18. type: choice
  19. options:
  20. - patch
  21. - minor
  22. - major
  23. - rc
  24. - beta
  25. - alpha
  26. - release
  27. - version
  28. version:
  29. description: Version (used with level "version")
  30. required: false
  31. type: string
  32. dry-run:
  33. description: Dry run
  34. required: true
  35. default: true
  36. type: boolean
  37. create-release:
  38. description: Create a GitHub release
  39. required: true
  40. type: boolean
  41. default: true
  42. jobs:
  43. set_env:
  44. name: Set variables to be used in strategy definitions
  45. runs-on: ubuntu-latest
  46. outputs:
  47. RUST_TOOLCHAIN_NIGHTLY: ${{ steps.compute.outputs.RUST_TOOLCHAIN_NIGHTLY }}
  48. SOLANA_CLI_VERSION: ${{ steps.compute.outputs.SOLANA_CLI_VERSION }}
  49. TARGET: ${{ steps.compute.outputs.TARGET }}
  50. steps:
  51. - name: Git Checkout
  52. uses: actions/checkout@v4
  53. - name: Compute variables
  54. id: compute
  55. shell: bash
  56. run: |
  57. echo "RUST_TOOLCHAIN_NIGHTLY=$(make rust-toolchain-nightly)" >> "$GITHUB_OUTPUT"
  58. echo "SOLANA_CLI_VERSION=$(make solana-cli-version)" >> "$GITHUB_OUTPUT"
  59. TARGET=$(echo ${{ inputs.package-path }} | sed 's#/#-#')
  60. echo "TARGET=$TARGET" >> "$GITHUB_OUTPUT"
  61. main:
  62. needs: set_env
  63. uses: solana-program/actions/.github/workflows/publish-rust.yml@main
  64. with:
  65. sbpf-program-packages: "program confidential-elgamal-registry"
  66. solana-cli-version: ${{ needs.set_env.outputs.SOLANA_CLI_VERSION }}
  67. clippy-toolchain: ${{ needs.set_env.outputs.RUST_TOOLCHAIN_NIGHTLY }}
  68. rustfmt-toolchain: ${{ needs.set_env.outputs.RUST_TOOLCHAIN_NIGHTLY }}
  69. target: ${{ needs.set_env.outputs.TARGET }}
  70. package-path: ${{ inputs.package-path }}
  71. level: ${{ inputs.level }}
  72. version: ${{ inputs.version }}
  73. create-release: ${{ inputs.create-release }}
  74. dry-run: ${{ inputs.dry-run }}
  75. secrets: inherit