Skip to content

Commit

Permalink
Break into separate lib and bin crates
Browse files Browse the repository at this point in the history
  • Loading branch information
sean0x42 committed Oct 13, 2024
1 parent 98b36bd commit a0f674d
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 37 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ jobs:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v4

- id: extract-changelog
uses: sean0x42/markdown-extract@v2
with:
file: CHANGELOG.md
pattern: ${{ github.ref_name }}
- id: extract-changelog
uses: sean0x42/markdown-extract@v2
with:
file: crates/markdown-extract/CHANGELOG.md
pattern: ${{ github.ref_name }}

- name: Create release
uses: softprops/action-gh-release@v1
with:
name: Release ${{ github.ref_name }}
tag_name: ${{ github.ref }}
body: ${{ steps.extract-changelog.outputs.markdown }}
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
- name: Create release
uses: softprops/action-gh-release@v1
with:
name: Release ${{ github.ref_name }}
tag_name: ${{ github.ref }}
body: ${{ steps.extract-changelog.outputs.markdown }}
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
32 changes: 10 additions & 22 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
[package]
name = "markdown-extract"
description = "Extract sections of a markdown file with a regular expression."
version = "2.0.0"
authors = ["Sean Bailey <[email protected]>"]
license = "MIT"
repository = "https://github.com/sean0x42/markdown-extract"
keywords = ["markdown", "extract"]
edition = "2018"
exclude = [".github/*"]
readme = "README.md"
# [package]
# name = "markdown-extract-monorepo"
# description = "Extract sections of a markdown file with a regular expression"
# version = "0.1.0"
# authors = ["Sean Bailey <[email protected]>"]
# license = "MIT"
# readme = "README.md"

[lib]
path = "src/lib.rs"

[[bin]]
name = "markdown-extract"
path = "src/bin.rs"

[dependencies]
anyhow = "1.0.89"
clap = { version = "4.5.20", features = ["derive"] }
regex = "1.3"
[workspace]
members = ["crates/markdown-extract", "crates/markdown-extract-cli"]
resolver = "2"
1 change: 1 addition & 0 deletions crates/markdown-extract-cli/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
14 changes: 14 additions & 0 deletions crates/markdown-extract-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "markdown-extract-cli"
version = "0.1.0"
edition = "2021"

[[bin]]
name = "markdown-extract"
path = "src/main.rs"

[dependencies]
anyhow = "1.0.89"
clap = { version = "4.5.20", features = ["derive"] }
markdown-extract = { path = "../markdown-extract" }
regex = "1.3"
File renamed without changes.
2 changes: 2 additions & 0 deletions CHANGELOG.md → crates/markdown-extract/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
Patch notes are automatically extracted from this changelog whenever a tag is
pushed to the GitHub repository. The heading must start with the tag name.

## v2.0.1 (October 2024)

## v2.0.0 (January 2021)

In this release, `markdown-extract` has been dramatically simplified, and comes
Expand Down
17 changes: 17 additions & 0 deletions crates/markdown-extract/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "markdown-extract"
description = "Extract sections of a markdown file with a regular expression"
version = "2.0.1"
edition = "2021"
authors = ["Sean Bailey <[email protected]>"]
license = "MIT"
repository = "https://github.com/sean0x42/markdown-extract"
keywords = ["markdown", "extract"]
readme = "README.md"

[lib]
name = "markdown_extract"
crate-type = ["lib"]

[dependencies]
regex = "1.3"
1 change: 1 addition & 0 deletions crates/markdown-extract/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# markdown-extract
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit a0f674d

Please sign in to comment.