Skip to content

Feature Request: Add GitHub Actions support via action.yml #952

Open
@PJ-568

Description

@PJ-568

Search before asking

  • 我在 issues 列表中搜索,没有找到类似的内容。
    I searched in the issues and found nothing similar.

Motivation

中文翻译参考

功能请求:通过 action.yml 添加 GitHub Actions 支持

功能描述

目前 Pake 不支持作为 GitHub Action 直接调用,而这一功能对于自动化打包网页应用将非常实用。现提议添加 action.yml 文件以实现该功能。

预期使用方式

作为用户,我希望能在 GitHub 工作流中这样使用 Pake:

- name: 构建 Pake 应用包
  uses: tw93/[email protected]                  # 或最新版本
  with:
    target-dir: 'output'                  # 可选,默认为当前目录
    url: 'https://example.com'
    use-local-file: 'assets/index.html'   # 可选,用于离线网页应用
    name-linux: 'my-app'                  # 可选,自定义应用名称
    name: 'myApp'                         # 可选,自定义应用名称
    icon: 'assets/icon.ico'               # 可选,自定义图标
    png-icon: 'assets/icon.png'
    icns: 'assets/icon.icns'

对于多个 URL 的情况,可通过以下两种方式提供:

  1. 多行字符串形式
  2. JSON 数组形式:
[
    {
        "name": "Sandbox",
        "description": "Sandbox",
        "version": "1.0",
        "author": "Sandbox",
        "url-or-src": "https://sandbox.com",
        "use-local-file": "false",
        "icons": [
            {
                "src": "https://sandbox.com/icon.png",
                "sizes": "512x512"
            },
            {
                "src": "https://sandbox.com/icon.ico",
                "sizes": "64x64"
            },
            {
                "src": "https://sandbox.com/icon.icns",
                "sizes": "64x64"
            }
        ]
    },
    {
        "name": "Local",
        "description": "Local",
        "version": "1.0",
        "author": "Local",
        "url-or-src": "html/index.html",
        "use-local-file": "true",
        "icons": [
            {
                "src": "html/assets/icon.png",
                "sizes": "512x512"
            },
            {
                "src": "html/assets/icon.ico",
                "sizes": "64x64"
            },
            {
                "src": "html/assets/icon.icns",
                "sizes": "64x64"
            }
        ]
    }
]

优势

  1. 自动化:实现 Pake 打包的 CI/CD 流水线
  2. 批量处理:一次性构建多个应用包
  3. 版本控制:将打包应用与源代码变更同步管理
  4. 降低门槛:让新用户更容易上手使用

实现说明

  1. 该 Action 需要实现:

    • 配置 Rust/Tauri 环境
    • 克隆 Pake(或作为模板使用)
    • 处理输入参数
    • 构建目标平台应用包
    • 输出构建产物
  2. 可支持不同平台的矩阵构建。

是否考虑接受该功能?如果提供实现方案的指导,我很乐意参与贡献。

Description

Currently, Pake doesn't support being directly invoked as a GitHub Action, which would be incredibly useful for automating the packaging of web apps. I'm requesting the addition of an action.yml file to enable this functionality.

Expected Usage

As a user, I'd like to be able to use Pake in my GitHub workflows like this:

- name: Build Pake packages
  uses: tw93/[email protected]                  # or latest version
  with:
    target-dir: 'output'                  # Optional, default to current dir
    url: 'https://example.com'
    use-local-file: 'assets/index.html'   # Optional, for offline web apps
    name-linux: 'my-app'                  # Optional, custom app name
    name: 'myApp'                         # Optional, custom app name
    icon: 'assets/icon.ico'               # Optional, custom icon
    png-icon: 'assets/icon.png'
    icns: 'assets/icon.icns'

For multiple apps and URLs, they could be provided either:

  1. As a multi-line string
  2. As a JSON array:
[
    {
        "name": "Sandbox",
        "description": "Sandbox",
        "version": "1.0",
        "author": "Sandbox",
        "url-or-src": "https://sandbox.com",
        "use-local-file": "false",
        "icons": [
            {
                "src": "https://sandbox.com/icon.png",
                "sizes": "512x512"
            },
            {
                "src": "https://sandbox.com/icon.ico",
                "sizes": "64x64"
            },
            {
                "src": "https://sandbox.com/icon.icns",
                "sizes": "64x64"
            }
        ]
    },
    {
        "name": "Local",
        "description": "Local",
        "version": "1.0",
        "author": "Local",
        "url-or-src": "html/index.html",
        "use-local-file": "true",
        "icons": [
            {
                "src": "html/assets/icon.png",
                "sizes": "512x512"
            },
            {
                "src": "html/assets/icon.ico",
                "sizes": "64x64"
            },
            {
                "src": "html/assets/icon.icns",
                "sizes": "64x64"
            }
        ]
    }
]

Benefits

  1. Automation: Enable CI/CD pipelines for Pake packages
  2. Batch Processing: Build multiple packages at once
  3. Version Control: Track changes to packaged apps alongside source
  4. Community Adoption: Lower barrier to entry for new users

Implementation Notes

  1. The action would need to:

    • Set up Rust/Tauri environment
    • Clone Pake (or use as template)
    • Process input parameters
    • Build packages for target platforms
    • Output artifacts
  2. Could support matrix builds for different platforms.

Would you be open to this feature? I'd be happy to help contribute if guidance is provided on the preferred implementation approach.

Solution

No response

Alternatives

No response

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions