Skip to content

Commit 8847990

Browse files
authored
Merge pull request #2 from coscene-io/feat-README
feat: add README file
2 parents 3b73571 + 4027a08 commit 8847990

File tree

2 files changed

+138
-0
lines changed

2 files changed

+138
-0
lines changed

README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Update-APT-Source GitHub Action
2+
3+
A GitHub Action for managing Debian/Ubuntu APT repositories, parsing .deb packages and publishing them to cloud storage services.
4+
5+
## Features
6+
7+
- Parse and process Debian package (.deb) files
8+
- Support various compression formats (gz, xz, zst) for control files
9+
- Generate complete APT repository structure (Packages, Release files)
10+
- Calculate and verify checksums (MD5, SHA1, SHA256, SHA512)
11+
- Implement GPG signing to ensure repository security
12+
- Support multiple architectures (amd64, arm64, etc.)
13+
- Support multiple Ubuntu distributions (bionic, focal, jammy, noble, etc.)
14+
- Integration with Aliyun OSS storage service
15+
16+
## Usage in GitHub Workflow
17+
18+
Create a workflow file in your GitHub repository (e.g.: `.github/workflows/update-apt.yml`):
19+
20+
```yaml
21+
name: Update APT Repository
22+
on:
23+
push:
24+
tags:
25+
- 'v*'
26+
27+
jobs:
28+
update-apt-repo:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v3
33+
- name: Update APT Source
34+
uses: coscene-io/update-apt-source@v1
35+
with:
36+
ubuntu-distro: noble
37+
deb-paths: |
38+
./dist/myapp_1.0.0_amd64.deb
39+
./dist/myapp_1.0.0_arm64.deb
40+
architectures: |
41+
amd64
42+
arm64
43+
oss-key-id: ${{ secrets.ALIYUN_ACCESS_KEY_ID }}
44+
oss-key-secret: ${{ secrets.ALIYUN_ACCESS_KEY_SECRET }}
45+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
46+
```
47+
48+
## Inputs
49+
50+
| Input Name | Description | Required |
51+
|------------|-------------|----------|
52+
| `ubuntu-distro` | Ubuntu distribution codename (e.g., `focal`, `jammy`, or `all`) | Yes |
53+
| `deb-paths` | Paths to .deb packages, separated by newlines | Yes |
54+
| `architectures` | Architectures for each .deb package, separated by newlines, in the same order as deb-paths, with the same number of entries as deb-paths | Yes |
55+
| `oss-key-id` | Aliyun OSS Access Key ID | Yes |
56+
| `oss-key-secret` | Aliyun OSS Access Key Secret | Yes |
57+
| `gpg-private-key` | GPG private key for signing | Yes |
58+
59+
## How It Works
60+
61+
1. Parse specified .deb packages and extract metadata
62+
2. Generate APT repository structure based on specified Ubuntu distribution and architecture
63+
3. Create Packages file containing detailed information of all packages
64+
4. Generate and sign Release file to ensure repository integrity
65+
5. Upload packages and metadata files to Aliyun OSS storage
66+
67+
## Security Note
68+
69+
Always use GitHub repository Secrets to store sensitive information like keys and tokens. Never expose these values directly in your workflow files.

README_CN.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Update-APT-Source GitHub Action
2+
3+
一个用于管理Debian/Ubuntu APT软件源的GitHub Action,支持解析.deb包并将其发布到云存储服务。
4+
5+
## 功能特点
6+
7+
- 解析和处理Debian软件包(.deb)文件
8+
- 支持多种压缩格式(gz、xz、zst)的控制文件
9+
- 生成完整的APT仓库结构(Packages、Release文件等)
10+
- 计算并验证各种校验和(MD5, SHA1, SHA256, SHA512)
11+
- 使用GPG进行签名,确保软件源安全性
12+
- 支持多架构(amd64, arm64等)
13+
- 支持多个Ubuntu发行版(bionic, focal, jammy, noble等)
14+
- 与阿里云OSS存储服务集成
15+
16+
## 在GitHub Workflow中使用
17+
18+
在你的GitHub仓库中创建一个工作流程文件(如:`.github/workflows/update-apt.yml`):
19+
20+
```yaml
21+
name: Update APT Repository
22+
on:
23+
push:
24+
tags:
25+
- 'v*'
26+
27+
jobs:
28+
update-apt-repo:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v3
33+
- name: Update APT Source
34+
uses: coscene-io/update-apt-source@v1
35+
with:
36+
ubuntu-distro: noble
37+
deb-paths: |
38+
./dist/myapp_1.0.0_amd64.deb
39+
./dist/myapp_1.0.0_arm64.deb
40+
architectures: |
41+
amd64
42+
arm64
43+
oss-key-id: ${{ secrets.ALIYUN_ACCESS_KEY_ID }}
44+
oss-key-secret: ${{ secrets.ALIYUN_ACCESS_KEY_SECRET }}
45+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
46+
```
47+
48+
## 输入参数
49+
50+
| 参数名 | 描述 | 是否必需 |
51+
|-------------------|-------------------------------------------------------|------|
52+
| `ubuntu-distro` | Ubuntu发行版代号(如`focal`, `jammy` 等,或者 `all`) | 是 |
53+
| `deb-paths` | .deb包的路径,多个路径用换行符分隔 | 是 |
54+
| `architectures` | 对应每个.deb包的架构,多个架构用换行符分隔,顺序与deb-paths一致,数量与deb-paths一致 | 是 |
55+
| `oss-key-id` | 阿里云OSS的Access Key ID | 是 |
56+
| `oss-key-secret` | 阿里云OSS的Access Key Secret | 是 |
57+
| `gpg-private-key` | 用于签名的GPG私钥 | 是 |
58+
59+
## 工作原理
60+
61+
1. 解析指定的.deb包,提取元数据信息
62+
2. 根据指定的Ubuntu发行版和架构,生成APT仓库结构
63+
3. 生成Packages文件,包含所有软件包的详细信息
64+
4. 创建并签名Release文件,确保软件源完整性
65+
5. 将软件包和元数据文件上传到阿里云OSS存储
66+
67+
## 安全提示
68+
69+
存储敏感信息(如密钥和令牌)请使用GitHub仓库的Secrets功能。请勿直接在工作流文件中暴露这些值。

0 commit comments

Comments
 (0)