A Forgejo action that submits a new version of a program to the JCOllie winget source as a pull request.
winget-submit CONTRIBUTING.md
1.8 kB · 56 lines
Markdown
at main

Contributing #

This action serves one source, the JCOllie winget source built from jeff/winget-pkgs, so its words come from that repository's GLOSSARY.md and its design from that repository's docs/adr/. Read both before changing it.

Changes are welcome at https://tangled.org/jcollie.dev/winget-submit.

Setting up #

Everything the repository needs comes from its Nix flake:

nix develop

Layout #

  • action.yml — the composite action. It passes its inputs on as WINGET_SUBMIT_* environment variables and runs the flake's submit package.
  • winget_submit.py — the whole of what the action does: clone jeff/winget-pkgs, run wingetsource new-version and check there, push the branch and open the pull request. It uses only Python's standard library.
  • tests/ — its tests, of everything that is not git or the forge's API.

The manifest is written by wingetsource new-version in jeff/winget-pkgs, never here; its ADR 0004 says why. The action relies only on that command's options and its --json output, which may be added to but not changed.

Testing #

nix develop -c python3 -m unittest discover -s tests -t .
nix build .#submit

A dry run does everything against the real jeff/winget-pkgs but push, and needs no token:

WINGET_SUBMIT_IDENTIFIER=JCOllie.Clipwatch WINGET_SUBMIT_VERSION=0.2.1 \
WINGET_SUBMIT_INSTALLERS='x64 https://git.jcollie.dev/...' \
WINGET_SUBMIT_DRY_RUN=true nix run .#submit

Licensing #

Every file carries an SPDX header or is covered by REUSE.toml, and nix develop -c reuse lint must pass.