Multi-registry package publisher for Forgejo/Gitea — RPM, ALT, Debian, Generic, npm
- JavaScript 100%
|
All checks were successful
CI / test (push) Successful in 6s
Now usable as:
uses: hermes/forgejo-publish@v1
with:
type: rpm
files: '*.rpm'
token: ${{ secrets.REGISTRY_TOKEN }}
|
||
|---|---|---|
| .forgejo/workflows | ||
| bin | ||
| src | ||
| test | ||
| .gitignore | ||
| action.yml | ||
| package.json | ||
| README.md | ||
forgejo-publish
Multi-registry package publisher for Forgejo/Gitea
Publishes packages to any Forgejo/Gitea package registry — RPM, ALT Linux, Debian, Generic, Alpine, Arch — with one simple CLI. Zero dependencies.
Why
Every Forgejo registry type has a different upload endpoint, different HTTP method, and different parameters. This tool unifies them all into a single CLI.
| Without forgejo-publish | With forgejo-publish |
|---|---|
curl -X PUT -F "file=@pkg.rpm" .../rpm/upload |
forgejo-publish rpm "*.rpm" |
curl -X PUT -F "file=@pkg.rpm" .../alt/crucible/upload |
forgejo-publish alt "*.rpm" --group crucible |
curl -X PUT --data-binary @file .../generic/myapp/1.0/file |
forgejo-publish generic "file" --packageName myapp --version 1.0 |
Install
npm install -g forgejo-publish
Or use directly with npx:
npx forgejo-publish rpm "*.rpm" --base-url ... --token ...
Usage
# Set env vars (optional, can pass as flags)
export FORGEJO_BASE_URL=https://git.wetgrape.su
export FORGEJO_OWNER=hermes
export FORGEJO_TOKEN=your-token
# RPM registry
forgejo-publish rpm "*.rpm"
forgejo-publish rpm "*.rpm" --skip-duplicate
# ALT Linux registry
forgejo-publish alt "*.rpm" --group crucible
# Debian registry
forgejo-publish deb "*.deb" --dist bookworm --component main
# Generic registry
forgejo-publish generic "app.tar.gz" --packageName myapp --version 1.0.0
# Alpine registry
forgejo-publish alpine "*.apk" --branch v3.22 --repository main
# Arch registry
forgejo-publish arch "*.pkg.tar.zst" --repository core
Supported Registry Types
| Type | Endpoint | Method |
|---|---|---|
rpm |
/api/packages/{owner}/rpm/upload |
PUT multipart |
alt |
/api/packages/{owner}/alt/{group}/upload |
PUT multipart |
deb |
/api/packages/{owner}/debian/pool/{dist}/{component}/upload |
PUT multipart |
generic |
/api/packages/{owner}/generic/{name}/{version}/{filename} |
PUT raw body |
alpine |
/api/packages/{owner}/alpine/{branch}/{repo}/upload |
PUT multipart |
arch |
/api/packages/{owner}/arch/{repo}/upload |
PUT multipart |
npm |
Use npm publish directly |
— |
As a Library
import { publish } from 'forgejo-publish';
await publish({
baseUrl: 'https://git.wetgrape.su',
owner: 'hermes',
token: 'xxx',
type: 'rpm',
files: ['artifacts/crucible-0.1.0-1.x86_64.rpm'],
skipDuplicate: true,
});
In Forgejo Actions
- name: Publish packages
run: |
npx forgejo-publish rpm "artifacts/*.rpm" \
--base-url ${{ github.server_url }} \
--owner ${{ github.repository_owner }} \
--token ${{ secrets.REGISTRY_TOKEN }} \
--skip-duplicate
License
MIT