publish-cli-rs.yml 2.4 KB

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