diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-10-01 15:21:27 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-10-01 15:39:23 +0900 |
| commit | a356dceedf0be29ae584866e540872ec1c048f59 (patch) | |
| tree | 45a85d0514fd60d923dd780caf2204f562d33e28 /internal/workflows/release.go | |
| parent | b0fa39b560d2caaaf0708c0828ae191311aee971 (diff) | |
internal/workflows: migrate release workflow
This also migrates from the unmaintained release action and improves
configuration so the new release is created as a draft, and the tag
annotation is automatically added as the release body.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/workflows/release.go')
| -rw-r--r-- | internal/workflows/release.go | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/internal/workflows/release.go b/internal/workflows/release.go index 6322a0e0..f220c0f7 100644 --- a/internal/workflows/release.go +++ b/internal/workflows/release.go @@ -4,31 +4,46 @@ package main var _ = (&Workflow{ Name: "Release", - On: Map[any]{{K: "push", V: Map[string]{{K: "tags", V: "v*"}}}}, + On: Map[any]{{"push", Map[[]string]{{"tags", []string{"v*"}}}}}, Jobs: []KV[Job]{ - {K: "release", V: Job{ + {"release", Job{ Name: "Create release", - On: "nix", + On: "rosa", Steps: []Step{ - checkout, + fixup, { - Name: "Build for release", - Run: "nix build " + - "--print-out-paths " + - "--print-build-logs " + - "./test#dist", + Name: "Checkout", + Uses: "actions/checkout@v4", + + With: []KV[any]{ + {"fetch-depth", 0}, + {"fetch-tags", true}, + }, + }, + + { + Name: "Request distribution", + ID: "dist", + Run: "/rosa/bin/mbf ci dist -o result " + + ". \"$(cat cmd/dist/VERSION)-act\" && " + + "git tag " + + "--list " + + "--format='%(contents:body)' " + + "\"$(cat cmd/dist/VERSION)\" >> " + + "\"/tmp/release-body\"", }, { - Name: "Release", - Uses: "https://gitea.com/actions/release-action@main", + Name: "Create release", + Uses: "https://gitea.com/actions/gitea-release-action@v1.3.7", With: []KV[any]{ - {K: "files", V: "result/hakurei-**"}, - {K: "api_key", V: "${{secrets.RELEASE_TOKEN}}"}, + {"files", "result/hakurei-**"}, + {"body_path", "/tmp/release-body"}, + {"draft", true}, }, }, }, |
