feat(release): add semantic-release auto versioning
- Add .releaserc.json: conventional commits -> semantic version bump (major/minor/patch), updates Cargo.toml + Cargo.lock version, writes CHANGELOG.md, commits as 'chore(release): X.Y.Z [skip ci]' - Add release.yml: runs semantic-release on main push, then triggers publish.yml via workflow_dispatch with the new tag - Update publish.yml: add workflow_dispatch input (tag) so release workflow can trigger publish directly (GITHUB_TOKEN tag pushes do not trigger 'on: push: tags'); still supports manual tag pushes
This commit is contained in:
@@ -3,6 +3,15 @@ name: Publish to crates.io
|
||||
on:
|
||||
push:
|
||||
tags: ["v*.*.*"]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: "Git tag to publish (e.g. v0.2.0). Defaults to latest tag."
|
||||
required: false
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
@@ -10,7 +19,12 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ inputs.tag || github.event.ref || github.ref }}
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Publish mytheclipse
|
||||
run: cargo publish --allow-dirty --no-verify
|
||||
env:
|
||||
|
||||
Reference in New Issue
Block a user