2023-02-19 16:17:49 +03:00
|
|
|
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
2022-08-03 00:54:40 +03:00
|
|
|
name: publish cli.rs
|
|
|
|
env:
|
|
|
|
MACOSX_DEPLOYMENT_TARGET: '10.13'
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
repository_dispatch:
|
|
|
|
types: [publish-clirs]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2023-01-26 15:09:04 +03:00
|
|
|
runs-on: ${{ matrix.config.os }}
|
2022-08-03 00:54:40 +03:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-01-26 15:09:04 +03:00
|
|
|
config:
|
2023-04-04 16:58:09 +03:00
|
|
|
- os: ubuntu-20.04
|
2023-01-26 15:09:04 +03:00
|
|
|
rust_target: x86_64-unknown-linux-gnu
|
|
|
|
ext: ''
|
|
|
|
- os: macos-latest
|
|
|
|
rust_target: x86_64-apple-darwin
|
|
|
|
ext: ''
|
|
|
|
- os: macos-latest
|
|
|
|
rust_target: aarch64-apple-darwin
|
|
|
|
ext: ''
|
|
|
|
- os: windows-latest
|
|
|
|
rust_target: x86_64-pc-windows-msvc
|
|
|
|
ext: '.exe'
|
2022-08-03 00:54:40 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2023-01-26 15:09:04 +03:00
|
|
|
- name: 'Setup Rust'
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
2022-08-03 00:54:40 +03:00
|
|
|
with:
|
2023-01-26 15:09:04 +03:00
|
|
|
targets: ${{ matrix.config.rust_target }}
|
2023-04-04 16:58:09 +03:00
|
|
|
|
2023-01-26 15:09:04 +03:00
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
with:
|
|
|
|
key: ${{ matrix.config.rust_target }}
|
2022-08-03 00:54:40 +03:00
|
|
|
|
|
|
|
- name: install Linux dependencies
|
2023-01-26 15:09:04 +03:00
|
|
|
if: matrix.config.os == 'ubuntu-latest'
|
2022-08-03 00:54:40 +03:00
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y libgtk-3-dev
|
|
|
|
|
2023-01-26 15:09:04 +03:00
|
|
|
- name: Build CLI
|
2022-08-03 00:54:40 +03:00
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: build
|
|
|
|
args: --manifest-path ./tooling/cli/Cargo.toml --release
|
|
|
|
|
|
|
|
- name: Upload CLI
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2023-01-26 15:09:04 +03:00
|
|
|
name: cargo-tauri-${{ matrix.config.rust_target }}${{ matrix.config.ext }}
|
|
|
|
path: tooling/cli/target/release/cargo-tauri${{ matrix.config.ext }}
|
2022-08-03 00:54:40 +03:00
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
upload:
|
|
|
|
needs: build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Download built CLIs
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
path: outputs
|
|
|
|
|
|
|
|
- name: Pack archives
|
|
|
|
run: ./.scripts/ci/pack-cli.sh
|
|
|
|
|
|
|
|
- name: Get CLI version
|
|
|
|
run: echo "CLI_VERSION=$(cat tooling/cli/metadata.json | jq '."cli.js".version' -r)" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Publish release
|
|
|
|
uses: softprops/action-gh-release@50195ba7f6f93d1ac97ba8332a178e008ad176aa
|
|
|
|
with:
|
|
|
|
tag_name: cli.rs-v${{ env.CLI_VERSION }}
|
|
|
|
files: |
|
|
|
|
outputs/cargo-tauri-*.zip
|
|
|
|
outputs/cargo-tauri-*.tgz
|