publish-cli-rs.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # Copyright 2019-2023 Tauri Programme within The Commons Conservancy
  2. # SPDX-License-Identifier: Apache-2.0
  3. # SPDX-License-Identifier: MIT
  4. name: publish `tauri-cli`
  5. env:
  6. MACOSX_DEPLOYMENT_TARGET: '10.13'
  7. on:
  8. workflow_dispatch:
  9. repository_dispatch:
  10. types: [publish-clirs]
  11. jobs:
  12. build:
  13. runs-on: ${{ matrix.config.os }}
  14. strategy:
  15. fail-fast: false
  16. matrix:
  17. config:
  18. - os: ubuntu-20.04
  19. rust_target: x86_64-unknown-linux-gnu
  20. ext: ''
  21. args: ''
  22. - os: macos-latest
  23. rust_target: x86_64-apple-darwin
  24. ext: ''
  25. args: ''
  26. - os: macos-latest
  27. rust_target: aarch64-apple-darwin
  28. ext: ''
  29. args: ''
  30. - os: windows-latest
  31. rust_target: x86_64-pc-windows-msvc
  32. ext: '.exe'
  33. args: ''
  34. - os: windows-latest
  35. rust_target: aarch64-pc-windows-msvc
  36. ext: '.exe'
  37. args: '--no-default-features --features native-tls,native-tls-vendored'
  38. steps:
  39. - name: Checkout
  40. uses: actions/checkout@v3
  41. - name: 'Setup Rust'
  42. uses: dtolnay/rust-toolchain@stable
  43. with:
  44. targets: ${{ matrix.config.rust_target }}
  45. - uses: Swatinem/rust-cache@v2
  46. with:
  47. key: ${{ matrix.config.rust_target }}
  48. - name: install Linux dependencies
  49. if: matrix.config.os == 'ubuntu-latest'
  50. run: |
  51. sudo apt-get update
  52. sudo apt-get install -y libgtk-3-dev
  53. - name: Build CLI
  54. uses: actions-rs/cargo@v1
  55. with:
  56. command: build
  57. args: --manifest-path ./tooling/cli/Cargo.toml --release ${{ matrix.config.args }}
  58. - name: Upload CLI
  59. uses: actions/upload-artifact@v3
  60. with:
  61. name: cargo-tauri-${{ matrix.config.rust_target }}${{ matrix.config.ext }}
  62. path: tooling/cli/target/release/cargo-tauri${{ matrix.config.ext }}
  63. if-no-files-found: error
  64. upload:
  65. needs: build
  66. runs-on: ubuntu-latest
  67. steps:
  68. - name: Checkout
  69. uses: actions/checkout@v3
  70. - name: Download built CLIs
  71. uses: actions/download-artifact@v3
  72. with:
  73. path: outputs
  74. - name: Pack archives
  75. run: ./.scripts/ci/pack-cli.sh
  76. - name: Get CLI version
  77. run: echo "CLI_VERSION=$(cat tooling/cli/metadata.json | jq '."cli.js".version' -r)" >> $GITHUB_ENV
  78. - name: Publish release
  79. uses: softprops/action-gh-release@50195ba7f6f93d1ac97ba8332a178e008ad176aa
  80. with:
  81. tag_name: tauri-cli-v${{ env.CLI_VERSION }}
  82. files: |
  83. outputs/cargo-tauri-*.zip
  84. outputs/cargo-tauri-*.tgz