publish-cli-rs.yml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 cli.rs
  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-18.04
  19. rust_target: x86_64-unknown-linux-gnu
  20. ext: ''
  21. - os: macos-latest
  22. rust_target: x86_64-apple-darwin
  23. ext: ''
  24. - os: macos-latest
  25. rust_target: aarch64-apple-darwin
  26. ext: ''
  27. - os: windows-latest
  28. rust_target: x86_64-pc-windows-msvc
  29. ext: '.exe'
  30. steps:
  31. - name: Checkout
  32. uses: actions/checkout@v3
  33. - name: 'Setup Rust'
  34. uses: dtolnay/rust-toolchain@stable
  35. with:
  36. targets: ${{ matrix.config.rust_target }}
  37. - uses: Swatinem/rust-cache@v2
  38. with:
  39. key: ${{ matrix.config.rust_target }}
  40. - name: install Linux dependencies
  41. if: matrix.config.os == 'ubuntu-latest'
  42. run: |
  43. sudo apt-get update
  44. sudo apt-get install -y libgtk-3-dev
  45. - name: Build CLI
  46. uses: actions-rs/cargo@v1
  47. with:
  48. command: build
  49. args: --manifest-path ./tooling/cli/Cargo.toml --release
  50. - name: Upload CLI
  51. uses: actions/upload-artifact@v3
  52. with:
  53. name: cargo-tauri-${{ matrix.config.rust_target }}${{ matrix.config.ext }}
  54. path: tooling/cli/target/release/cargo-tauri${{ matrix.config.ext }}
  55. if-no-files-found: error
  56. upload:
  57. needs: build
  58. runs-on: ubuntu-latest
  59. steps:
  60. - name: Checkout
  61. uses: actions/checkout@v3
  62. - name: Download built CLIs
  63. uses: actions/download-artifact@v3
  64. with:
  65. path: outputs
  66. - name: Pack archives
  67. run: ./.scripts/ci/pack-cli.sh
  68. - name: Get CLI version
  69. run: echo "CLI_VERSION=$(cat tooling/cli/metadata.json | jq '."cli.js".version' -r)" >> $GITHUB_ENV
  70. - name: Publish release
  71. uses: softprops/action-gh-release@50195ba7f6f93d1ac97ba8332a178e008ad176aa
  72. with:
  73. tag_name: cli.rs-v${{ env.CLI_VERSION }}
  74. files: |
  75. outputs/cargo-tauri-*.zip
  76. outputs/cargo-tauri-*.tgz