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
20 changes: 0 additions & 20 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,3 @@ jobs:
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose

- uses: actions/checkout@v3
with:
fetch-depth: 0 # required for git-cliff

- name: Install git-cliff
run: cargo install git-cliff

- name: Generate changelog
run: git-cliff -o CHANGELOG.md

- name: Commit changelog
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git add CHANGELOG.md
git commit -m "chore: update changelog for release" || echo "no changes"

- name: Push changelog
run: git push origin main || echo "no changes"
38 changes: 13 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Release
name: Release Crate

on:
workflow_dispatch:
inputs:
level:
description: "Release level (patch, minor, major)"
required: true
default: patch
type: choice
options:
- patch
Expand All @@ -14,40 +15,27 @@ on:

jobs:
release:
name: Release Crate
name: Cargo Release
runs-on: ubuntu-latest
permissions:
contents: write
contents: write # for pushing tags/commits
steps:
- name: Checkout branch
- name: Checkout code
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_PAT }}
fetch-depth: 0 # required for git-cliff
fetch-depth: 0 # required for tagging and changelog

- name: Configure Git
- name: Setup Git identity
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

- name: Install dependencies
run: |
cargo install cargo-release
cargo install git-cliff

- name: Generate Changelog
run: |
git cliff -o CHANGELOG.md
- name: Install cargo-release
run: cargo install cargo-release

- name: Commit Changelog
run: |
git add CHANGELOG.md
git commit -m "chore(changelog): update CHANGELOG.md for release" || echo "No changes to commit"
git push origin HEAD

- name: Perform Release
run: |
LEVEL="${{ github.event.inputs.level}}"
cargo release $LEVEL --execute --no-confirm
- name: Run cargo-release
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN}}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
cargo release ${{ github.event.inputs.level }} --execute --no-confirm
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to this project will be documented in this file.

## [unreleased] - ReleaseDate
## [1.2.0] - 2025-06-28

### ⚙️ Miscellaneous Tasks

Expand Down
15 changes: 11 additions & 4 deletions release.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
pre-release-replacements = [
{ file = "CHANGELOG.md", search = "unreleased", replace = "{{version}}" },
{ file = "CHANGELOG.md", search = "ReleaseDate", replace = "{{date}}" },
{ file = "README.md", search = "^paystack-rs = \".*\"$", replace = "{{crate_name}} = \"{{version}}\"" },
{ file = "src/lib.rs", search = "^//! paystack-rs = \".*\"$", replace = "//! {{crate_name}} = \"{{version}}\"" },
]
pre-release-hook = [
"git",
"cliff",
"-o",
"CHANGELOG.md",
"--tag",
"{{version}}",
]

# Configure the release process
[release]
sign-commit = false
sign-tag = false
Expand All @@ -12,4 +19,4 @@ publish = true
allow-branch = ["main"]
consolidate-commits = false
changelog = true
changelog_command = "git cliff -o CHANGELOG.md -n"
changelog_command = "cargo release changelog"
Loading