publish-cli-rs.yml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. name: publish cli.rs
  2. env:
  3. MACOSX_DEPLOYMENT_TARGET: '10.13'
  4. on:
  5. workflow_dispatch:
  6. repository_dispatch:
  7. types: [publish-clirs]
  8. jobs:
  9. build:
  10. runs-on: ${{ matrix.target.platform }}
  11. strategy:
  12. fail-fast: false
  13. matrix:
  14. target:
  15. - {
  16. name: 'x86_64-unknown-linux-gnu',
  17. platform: 'ubuntu-18.04',
  18. ext: ''
  19. }
  20. - { name: 'x86_64-apple-darwin', platform: 'macos-latest', ext: '' }
  21. - {
  22. name: 'x86_64-pc-windows-msvc',
  23. platform: 'windows-latest',
  24. ext: '.exe'
  25. }
  26. steps:
  27. - name: Checkout
  28. uses: actions/checkout@v3
  29. - name: install stable
  30. uses: actions-rs/toolchain@v1
  31. with:
  32. toolchain: stable
  33. - name: install Linux dependencies
  34. if: matrix.target.platform == 'ubuntu-latest'
  35. run: |
  36. sudo apt-get update
  37. sudo apt-get install -y libgtk-3-dev
  38. - name: build CLI
  39. uses: actions-rs/cargo@v1
  40. with:
  41. command: build
  42. args: --manifest-path ./tooling/cli/Cargo.toml --release
  43. - name: Upload CLI
  44. uses: actions/upload-artifact@v3
  45. with:
  46. name: cargo-tauri-${{ matrix.target.name }}${{ matrix.target.ext }}
  47. path: tooling/cli/target/release/cargo-tauri${{ matrix.target.ext }}
  48. if-no-files-found: error
  49. upload:
  50. needs: build
  51. runs-on: ubuntu-latest
  52. steps:
  53. - name: Checkout
  54. uses: actions/checkout@v3
  55. - name: Download built CLIs
  56. uses: actions/download-artifact@v3
  57. with:
  58. path: outputs
  59. - name: Pack archives
  60. run: ./.scripts/ci/pack-cli.sh
  61. - name: Get CLI version
  62. run: echo "CLI_VERSION=$(cat tooling/cli/metadata.json | jq '."cli.js".version' -r)" >> $GITHUB_ENV
  63. - name: Publish release
  64. uses: softprops/action-gh-release@50195ba7f6f93d1ac97ba8332a178e008ad176aa
  65. with:
  66. tag_name: cli.rs-v${{ env.CLI_VERSION }}
  67. files: |
  68. outputs/cargo-tauri-*.zip
  69. outputs/cargo-tauri-*.tgz