|
| 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. |
0 commit comments