Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,13 @@ jobs:
zip -vr "$archive_name" "$dir/maa.exe"
cp "$archive_name" "$archive_name_unversioned"
;;
*-windows-msvc-winget)
archive_name="maa_cli-v$VERSION-$target.zip"
archive_name_unversioned="maa_cli-$target.zip"
mv "$dir/maa.exe" "$dir/maa-cli.exe"
zip -j "$archive_name" "$dir/maa-cli.exe"
cp "$archive_name" "$archive_name_unversioned"
;;
*)
echo "Unknown target: $target"
exit 1
Expand Down Expand Up @@ -293,6 +300,7 @@ jobs:
maa_cli-*-unknown-linux-gnu.tar.gz
maa_cli-*-apple-darwin.zip
maa_cli-*-pc-windows-msvc.zip
maa_cli-*-pc-windows-msvc-winget.zip
- name: Commit version.json and Push
working-directory: version
run: |
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/winget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Update MAA-Cli in Winget

on:
workflow_dispatch:
schedule:
- cron: '0 12 * * *'
release:
types: [published]

jobs:
update-winget:
name: Update MAA in Winget Repository
runs-on: ubuntu-latest

steps:
- name: Install cargo binstall
uses: cargo-bins/cargo-binstall@268643a6b5ea099f5718ee5cd3ff7dc89a5eb49b

- name: Install komac
run: |
cargo binstall [email protected] -y

- name: Validate token
run: |
if [ -z "${{ secrets.WINGET_GITHUB_TOKEN }}" ]; then
echo "ERROR: WINGET_GITHUB_TOKEN secret is not set"
echo "Please create a Personal Access Token with 'repo' scope and add it to repository secrets"
exit 1
fi

- name: Determine latest version
id: version
run: |
LATEST_VERSION=$(curl -s "https://raw.githubusercontent.com/MaaAssistantArknights/maa-cli/version/stable.json" | jq -r '.[].version' | sed 's/^v//')
echo "Latest version: $LATEST_VERSION"
echo "version=$LATEST_VERSION" >> $GITHUB_OUTPUT

- name: Update Winget manifest
env:
KOMAC_VERSION: ${{ steps.version.outputs.version }}
run: |
komac update "MaaAssistantArknights.maa-cli" \
--version "$KOMAC_VERSION" \
--urls "https://github.com/MaaAssistantArknights/maa-cli/releases/download/v$KOMAC_VERSION/maa_cli-x86_64-pc-windows-msvc-winget.zip" "https://github.com/MaaAssistantArknights/MaaAssistantArknights/releases/download/v$KOMAC_VERSION/maa_cli-aarch64-pc-windows-msvc.zip" \
--submit \
--token "${{ secrets.WINGET_GITHUB_TOKEN }}"
30 changes: 29 additions & 1 deletion crates/maa-cli/docs/zh-CN/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,36 @@ Homebrew 用户可以通过非官方的 [tap](https://github.com/MaaAssistantArk

- 对于在 Linux 上使用 Homebrew 的用户,参见上述 macOS 的安装方式。

### Windows

- 对于 Windows 用户,可以使用 [winget](https://github.com/microsoft/winget-pkgs/tree/master/manifests/m/MaaAssistantArknights/maa-cli/) 管理 maa-cli:

- 安装

```bash
winget install maa-cli
```

- 升级

```bash
winget update maa-cli
```

- 卸载

```bash
winget uninstall maa-cli
```

- 你可以使用参数 `--purge` 来删除所有配置文件和数据文件;
若您使用过 `maa update` 来更新 maa-cli,请注意 winget 可能无法检测到通过该命令更新的版本,因此请使用 `--force` 参数以卸载 maa-cli 。

**请注意**,使用 Windows 包管理器 ( winget ) 安装的 maa-cli 在与同时使用 Windows 包管理器 ( winget ) 安装的 MAA GUI 在shell的命令中 ~(因为两个均为maa.exe)~ 存在冲突, 建议将其中一个重命名以避免冲突。~下个版本应该就会改了吧~

## 预编译二进制文件

如果你的系统不受支持或者不想使用包管理器,你可以点击以下链接下载对应平台的预编译二进制文件,解压后将可执行文件放入 `PATH` 中即可使用。
如果你的系统不受支持或者不想使用包管理器,你可以点击以下链接下载对应平台的预编译二进制文件,解压后将可执行文件放入 中即可使用。

- [macOS](https://github.com/MaaAssistantArknights/maa-cli/releases/latest/download/maa_cli-universal-apple-darwin.zip)
- [Linux x86_64 (x64, amd64)](https://github.com/MaaAssistantArknights/maa-cli/releases/latest/download/maa_cli-x86_64-unknown-linux-gnu.tar.gz)
Expand Down Expand Up @@ -100,6 +127,7 @@ maa install
```

对于使用包管理器安装的用户,可以通过包管理器安装 MaaCore:
对于使用 winget ( Windows 包管理器 ) 安装的用户,请直接使用 `maa update` 命令更新 MaaCore 到最新版本 ~( 因为一般不是最新 )~ 而无需再次安装 MaaCore 。并且您不需要通过 winget 再次安装必要工具组,因为 `winget` 在安装时会自动处理这些依赖项。

- Homebrew:

Expand Down