Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name-template: "v$RESOLVED_VERSION"
tag-template: "v$RESOLVED_VERSION"
categories:
- title: "Breaking Changes"
label: "breaking-change"
- title: "Dependencies"
collapse-after: 1
labels:
- "dependencies"

version-resolver:
major:
labels:
- "major"
- "breaking-change"
minor:
labels:
- "minor"
- "new-feature"
patch:
labels:
- "bugfix"
- "dependencies"
- "documentation"
- "enhancement"
default: patch

template: |
## What's Changed

$CHANGES

**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
41 changes: 41 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

name: Release Drafter

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: read

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
id: release-draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Update version number in Cargo.toml
- uses: actions/checkout@v4
- name: Calculate version
id: version
run: |
tag="${{ steps.release-draft.outputs.tag_name }}"
echo "version=${tag:1}" >> $GITHUB_OUTPUT

- name: Set Cargo.toml version
run: |
sed -i "s/version = .*/version = \"${{ steps.version.outputs.version }}\"/g" Cargo.toml
# github actions email from here: https://github.community/t/github-actions-bot-email-address/17204
- name: Commit changes
run: |
if ! git diff --quiet; then
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -am "Bump version to ${{ steps.version.outputs.version }}"
git push
fi