-
-
Notifications
You must be signed in to change notification settings - Fork 18
feat(github): Integrate action-prepare-release into Craft repo #667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
663bd11 to
0c472be
Compare
Move the action-prepare-release GitHub Action into the Craft repository root,
enabling usage as `getsentry/craft@v2`. This provides better version alignment
and allows Craft to dogfood its own action.
- Add `floatingTags` config option to create/update floating tags (e.g., v2)
- Support placeholders: {major}, {minor}, {patch}
- Example: `floatingTags: ['v{major}']` creates v2 tag for version 2.15.0
- Parametrized inputs replacing hardcoded Sentry-specific values:
- `blocker_label` (default: release-blocker)
- `publish_repo` (default: ${{ github.repository_owner }}/publish)
- `git_user_name`, `git_user_email` (default to GITHUB_ACTOR)
- Smart Craft installation:
- Downloads from build artifact when in getsentry/craft repo
- Falls back to release download using github.action_ref
- Outputs resolved version for downstream steps
- build.yml: Add workflow_call trigger for reusability
- release.yml: Call build workflow first, then use local action for dogfooding
- Add `floatingTags: ['v{major}']` to github target in .craft.yml
Repos using `getsentry/action-prepare-release@v1` can migrate to:
```yaml
uses: getsentry/craft@v2
with:
version: auto
git_user_name: getsentry-bot # if needed
git_user_email: [email protected] # if needed
```
Add a new `versioning` configuration option to `.craft.yml` that supports
`auto`, `manual`, and `calver` policies for version resolution.
## New Configuration
```yaml
versioning:
policy: auto | manual | calver # default based on minVersion
calver:
offset: 14 # days to go back (default: 14)
format: '%y.%-m' # strftime-like format (default: '%y.%-m')
```
## Behavior
- `craft prepare` (no arg): Uses `versioning.policy` from config
- `auto`: Analyze commits to determine bump type
- `manual`: Error if no version specified
- `calver`: Use calendar versioning
- `craft prepare calver`: Explicit CalVer override
- `craft prepare auto`: Explicit auto-versioning override
- `craft prepare 1.2.3`: Explicit version always works
## Policy Defaults
- `auto` if `minVersion >= 2.14.0`
- `manual` otherwise (backward compatible)
## New CLI Options
- `--calver-offset`: Override CalVer offset (days to go back)
## Environment Variables
- `CRAFT_CALVER_OFFSET`: Override CalVer offset
## CalVer Format
Supports strftime-like placeholders:
- `%y`: 2-digit year (e.g., "24")
- `%Y`: 4-digit year (e.g., "2024")
- `%m`: Zero-padded month (e.g., "01")
- `%-m`: Month without padding (e.g., "1")
- `%d`: Zero-padded day
- `%-d`: Day without padding
Example: `%y.%-m` produces "24.12" for December 2024
0c472be to
fce2ee0
Compare
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
| description: 'Load .craft.yml from the specified remote branch instead of local file', | ||
| type: 'string', | ||
| }) | ||
| .option('calver-offset', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Under what circumstance would this be needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For us, never as we always use the default value 14. But since Craft is meant to be a generic tool, some other folks may want to tweak this value.
Move the action-prepare-release GitHub Action into the Craft repository root,
enabling usage as
getsentry/craft@v2. This provides better version alignmentand allows Craft to dogfood its own action.
Add
floatingTagsconfig option to create/update floating tags (e.g., v2)Support placeholders: {major}, {minor}, {patch}
Example:
floatingTags: ['v{major}']creates v2 tag for version 2.15.0Parametrized inputs replacing hardcoded Sentry-specific values:
blocker_label(default: release-blocker)publish_repo(default: ${{ github.repository_owner }}/publish)git_user_name,git_user_email(default to GITHUB_ACTOR)Smart Craft installation:
Outputs resolved version for downstream steps
build.yml: Add workflow_call trigger for reusability
release.yml: Call build workflow first, then use local action for dogfooding
Add
floatingTags: ['v{major}']to github target in .craft.ymlRepos using
getsentry/action-prepare-release@v1can migrate to: