From d3cb76dc320f4b18698d5e33332ad232d8645329 Mon Sep 17 00:00:00 2001 From: Gabriel20xx Date: Thu, 6 Aug 2026 10:58:20 +0200 Subject: [PATCH] Add Gitea release trigger for Go package publishing --- .gitea/workflows/publish-go.yml | 5 ++++- README.md | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/publish-go.yml b/.gitea/workflows/publish-go.yml index d3155d8..be98a36 100644 --- a/.gitea/workflows/publish-go.yml +++ b/.gitea/workflows/publish-go.yml @@ -4,6 +4,9 @@ on: push: tags: - 'backend/v*' + release: + types: + - published jobs: publish: @@ -32,7 +35,7 @@ jobs: - name: Package Go module env: - RELEASE_TAG: ${{ github.ref_name }} + RELEASE_TAG: ${{ github.event_name == 'release' && github.event.release.tag_name || github.ref_name }} run: bash scripts/package-go-module.sh "$RELEASE_TAG" "$RUNNER_TEMP/gitea-go-package" - name: Publish to Gitea Package Registry diff --git a/README.md b/README.md index 8362a12..6a19fa5 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ Use `auth.SchemaOptions{SingleUser: false, APITokens: true}` for a multi-user se For embedded SQL migrations, use `migrate.Up(ctx, databaseURL, embeddedMigrations, "migrations")`. The package does not contain application tables, so migrations remain versioned with the service that owns those tables. -The Go module lives under `backend`, so its release tag must use the submodule prefix (`backend/v0.1.0`). The consuming `go.mod` uses the normal module version (`v0.1.0`). To publish a release, push a tag such as `backend/v0.1.0`; the Gitea workflow packages the module and uploads it to the private registry. Never reuse an existing package version. +The Go module lives under `backend`, so its release tag must use the submodule prefix (`backend/v0.1.0`). The consuming `go.mod` uses the normal module version (`v0.1.0`). To publish a release, push a tag such as `backend/v0.1.0`; the Gitea workflow packages the module and uploads it to the private registry. The workflow also listens for Gitea's `release.published` event, so a release can be published from the Gitea Releases page to manually retry a failed upload for an existing tag. Never reuse a package version that was already uploaded successfully. For Node services, install the shared package after publishing it: