diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index f77032b..1aff681 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -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 diff --git a/Cargo.toml b/Cargo.toml index 1a10970..bcba71e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 "] -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 "] +# 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" diff --git a/crates/markdown-extract-cli/.gitignore b/crates/markdown-extract-cli/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/crates/markdown-extract-cli/.gitignore @@ -0,0 +1 @@ +/target diff --git a/crates/markdown-extract-cli/Cargo.toml b/crates/markdown-extract-cli/Cargo.toml new file mode 100644 index 0000000..3736af2 --- /dev/null +++ b/crates/markdown-extract-cli/Cargo.toml @@ -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" diff --git a/src/bin.rs b/crates/markdown-extract-cli/src/main.rs similarity index 100% rename from src/bin.rs rename to crates/markdown-extract-cli/src/main.rs diff --git a/CHANGELOG.md b/crates/markdown-extract/CHANGELOG.md similarity index 98% rename from CHANGELOG.md rename to crates/markdown-extract/CHANGELOG.md index 386703f..66ba7a0 100644 --- a/CHANGELOG.md +++ b/crates/markdown-extract/CHANGELOG.md @@ -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 diff --git a/crates/markdown-extract/Cargo.toml b/crates/markdown-extract/Cargo.toml new file mode 100644 index 0000000..20c54ae --- /dev/null +++ b/crates/markdown-extract/Cargo.toml @@ -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 "] +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" diff --git a/crates/markdown-extract/README.md b/crates/markdown-extract/README.md new file mode 100644 index 0000000..a52d07b --- /dev/null +++ b/crates/markdown-extract/README.md @@ -0,0 +1 @@ +# markdown-extract diff --git a/src/heading.rs b/crates/markdown-extract/src/heading.rs similarity index 100% rename from src/heading.rs rename to crates/markdown-extract/src/heading.rs diff --git a/src/lib.rs b/crates/markdown-extract/src/lib.rs similarity index 100% rename from src/lib.rs rename to crates/markdown-extract/src/lib.rs diff --git a/src/state.rs b/crates/markdown-extract/src/state.rs similarity index 100% rename from src/state.rs rename to crates/markdown-extract/src/state.rs diff --git a/tests/extract.rs b/crates/markdown-extract/tests/extract.rs similarity index 100% rename from tests/extract.rs rename to crates/markdown-extract/tests/extract.rs diff --git a/tests/markdown/heading_in_code_block.md b/crates/markdown-extract/tests/markdown/heading_in_code_block.md similarity index 100% rename from tests/markdown/heading_in_code_block.md rename to crates/markdown-extract/tests/markdown/heading_in_code_block.md diff --git a/tests/markdown/multiple_matches.md b/crates/markdown-extract/tests/markdown/multiple_matches.md similarity index 100% rename from tests/markdown/multiple_matches.md rename to crates/markdown-extract/tests/markdown/multiple_matches.md