Skip to content

Commit 3193c12

Browse files
authored
ci: add release workflow (#49)
## Summary - Adds `.github/workflows/release.yml` — delegates to the org's [`release-composer-package`](https://github.com/netresearch/.github/blob/main/.github/workflows/release-composer-package.yml) reusable workflow ([introduced in netresearch/.github#124](netresearch/.github#124)). - Closes the missing-release-infrastructure gap flagged by the github-release skill's pre-release validation: v1.x and v2.0.0 were published manually because no automated release workflow existed. ## What the reusable workflow does On signed-tag push (`v*`): 1. **Tag validation** — strict semver gate (`v<MAJOR>.<MINOR>.<PATCH>[-pre][+build]`), reject lightweight tags 2. **`composer validate --strict --no-check-publish`** — catch malformed `composer.json` before Packagist sees it 3. **Prerelease auto-detect** — from `-rc` / `-alpha` / `-beta` / `-pre` suffix 4. **`make-latest` auto-compute** — by comparing against existing non-draft non-prerelease semver releases via the GH API 5. **Atomic release create** — single `softprops/action-gh-release@v3` call with `generate_release_notes: true`, no post-creation edits Packagist syncs the new version via its existing webhook on tag push, independent of this workflow. ## workflow_dispatch backfill Also enables `workflow_dispatch` with a `tag` input, so a release entry can be re-created for an existing tag (e.g. v2.0.0 if you ever want a structured release entry for it) without re-tagging. ## Test plan - [ ] PR CI passes (lint workflows, lint markdown, etc.) - [ ] First real test: the upcoming v2.1.0 tag (separate follow-up PR will land the CHANGELOG bump) - [ ] Verify the release workflow fires on tag push, runs to green, creates a GitHub Release with auto-generated notes
2 parents b96c966 + 7f98665 commit 3193c12

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release
2+
3+
# Triggered by signed-tag push (`v*`). Delegates the entire release to the
4+
# org's `release-composer-package` reusable workflow, which validates the
5+
# tag (semver, annotated/signed), validates `composer.json`, and creates
6+
# the GitHub Release atomically with auto-generated notes.
7+
#
8+
# Packagist syncs the new version via webhook on tag push, independent of
9+
# this workflow.
10+
11+
on:
12+
push:
13+
tags:
14+
- 'v*'
15+
workflow_dispatch:
16+
inputs:
17+
tag:
18+
description: "Tag to release (e.g. v2.1.0). Used for backfills."
19+
required: true
20+
type: string
21+
22+
permissions: {}
23+
24+
jobs:
25+
release:
26+
uses: netresearch/.github/.github/workflows/release-composer-package.yml@2c6869a6c4c3ed1afad61569fc587e32b6b7a4db # main
27+
permissions:
28+
contents: write
29+
with:
30+
# `inputs.tag` is only populated by workflow_dispatch; on tag-push the
31+
# `inputs` context is empty, so we fall back to `github.ref_name` (the
32+
# pushed tag). This makes the contract explicit at the caller boundary
33+
# instead of relying on the reusable workflow's empty-string fallback.
34+
tag: ${{ inputs.tag || github.ref_name }}

0 commit comments

Comments
 (0)