publish-cli-rs.yml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. # Copyright 2019-2024 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-vendored'
  38. steps:
  39. - uses: actions/checkout@v4
  40. - name: 'Setup Rust'
  41. uses: dtolnay/rust-toolchain@stable
  42. with:
  43. targets: ${{ matrix.config.rust_target }}
  44. - uses: Swatinem/rust-cache@v2
  45. with:
  46. key: ${{ matrix.config.rust_target }}
  47. - name: install Linux dependencies
  48. if: matrix.config.os == 'ubuntu-latest'
  49. run: |
  50. sudo apt-get update
  51. sudo apt-get install -y libgtk-3-dev
  52. - name: Build CLI
  53. run: cargo build --manifest-path ./crates/tauri-cli/Cargo.toml --profile release-size-optimized ${{ matrix.config.args }}
  54. - name: Upload CLI
  55. uses: actions/upload-artifact@v4
  56. with:
  57. name: cargo-tauri-${{ matrix.config.rust_target }}${{ matrix.config.ext }}
  58. path: target/release-size-optimized/cargo-tauri${{ matrix.config.ext }}
  59. if-no-files-found: error
  60. upload:
  61. needs: build
  62. runs-on: ubuntu-latest
  63. steps:
  64. - name: Checkout
  65. uses: actions/checkout@v4
  66. - name: Download built CLIs
  67. uses: actions/download-artifact@v4.1.7
  68. with:
  69. path: outputs
  70. - name: Pack archives
  71. run: ./.scripts/ci/pack-cli.sh
  72. - name: Get CLI version
  73. run: echo "CLI_VERSION=$(cat crates/tauri-cli/metadata-v2.json | jq '."cli.js".version' -r)" >> $GITHUB_ENV
  74. - name: Publish release
  75. uses: softprops/action-gh-release@50195ba7f6f93d1ac97ba8332a178e008ad176aa
  76. with:
  77. tag_name: tauri-cli-v${{ env.CLI_VERSION }}
  78. files: |
  79. outputs/cargo-tauri-*.zip
  80. outputs/cargo-tauri-*.tgz