Files
gentoo-zh/.github/workflows/bundles.yml
T
Zakk 3b3edd4462 .github: use one naming and formatting style across workflows
Workflow names now match their file stems, so the Actions list and the
files read the same; generate-deps-relation-r1.yml becomes
deps-table.yml after the branch it maintains. Steps are lowercase and
verb-first, every step is named, and the autobump-rb checkout has one
name everywhere.

Also use 4-space step indentation, fromJSON, bare if: expressions,
github.actor for every ghcr login, uppercase env names, and the
GITHUB_REPOSITORY and GITHUB_REPOSITORY_OWNER variables the runner
already sets instead of REPO and OWNER copies. No behaviour changes.

Signed-off-by: Zakk <zakk@gentoozh.org>
2026-10-11 04:30:43 +11:00

78 lines
2.4 KiB
YAML

name: bundles
on:
workflow_dispatch:
inputs:
packages:
description: 'category/package atoms, space separated'
required: true
version:
description: 'Gentoo version (one package only; empty = the newest ebuild)'
required: false
default: ''
mode:
description: 'status reads, prepare dispatches what is missing'
type: choice
options: [status, prepare]
default: status
permissions: {}
jobs:
bundles:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v7
- name: checkout autobump-rb
uses: actions/checkout@v7
with:
repository: gentoo-zh/autobump-rb
path: autobump-rb
# One failed token mint must not prevent the other owner from running.
- name: mint gentoo-deps token
id: deps-token
continue-on-error: true
uses: actions/create-github-app-token@v3
with:
client-id: ${{ secrets.DRAFTS_BOT_CLIENT_ID }}
private-key: ${{ secrets.DRAFTS_BOT_PRIVATE_KEY }}
owner: gentoo-zh
repositories: gentoo-deps
- name: mint gentoo-zh-drafts token
id: drafts-token
continue-on-error: true
uses: actions/create-github-app-token@v3
with:
client-id: ${{ secrets.DRAFTS_BOT_CLIENT_ID }}
private-key: ${{ secrets.DRAFTS_BOT_PRIVATE_KEY }}
owner: gentoo-zh-drafts
- name: run the bundle controller
env:
GH_TOKEN_GENTOO_ZH: ${{ steps.deps-token.outputs.token }}
GH_TOKEN_GENTOO_ZH_DRAFTS: ${{ steps.drafts-token.outputs.token }}
PACKAGES: ${{ inputs.packages }}
VERSION: ${{ inputs.version }}
MODE: ${{ inputs.mode }}
run: |
case "$MODE" in status|prepare) ;; *) echo "mode must be status or prepare: $MODE" >&2; exit 1;; esac
case "$PACKAGES" in ''|*[!A-Za-z0-9_.+/\ -]*) echo "packages must be category/package atoms: $PACKAGES" >&2; exit 1;; esac
case "$VERSION" in *[!A-Za-z0-9_.+-]*) echo "not a version: $VERSION" >&2; exit 1;; esac
args=()
[ -n "$VERSION" ] && args=(--version "$VERSION")
# shellcheck disable=SC2086
python3 autobump-rb/bin/bundles.py "$MODE" $PACKAGES "${args[@]}" --out bundles.json
- name: upload snapshot
if: always()
continue-on-error: true
uses: actions/upload-artifact@v7
with:
name: bundles
path: bundles.json
if-no-files-found: ignore