Skip to content

Commit

Permalink
Tr grab release notes from changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
PEZ committed Nov 4, 2024
1 parent e25f504 commit 0ade363
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- '*'
pull_request:
branches:
- 'main'
- 'master'
workflow_call:

jobs:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,15 @@ jobs:
name: ${{ env.VSIX_NAME }}
path: .

- name: Get Release Notes
id: release_notes
run: bb get-release-notes ${{ github.ref_name }} >> $GITHUB_OUTPUT

- name: Release
uses: softprops/action-gh-release@v2
with:
body: |
$(bb release-notes ${{ github.ref_name }})
files: ${{ env.VSIX_NAME }}

# - name: Publish to VS Code Marketplace
Expand Down
22 changes: 12 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,47 @@ Changes to Paste Replaced

## [Unreleased]

## [1.1.12] - 2024-11-04
- 7 Testing release workflow

## [v1.1.12] - 2024-11-04

- 6 Testing release workflow

## [1.1.11] - 2022-11-18
## [v1.1.11] - 2022-11-18

- Add command **Paste Replaced: Paste From Canned...**
- Add command **Paste Replaced: Paste Text...**
- Add some more error handling

## [1.1.10] - 2022-11-15
## [v1.1.10] - 2022-11-15

- [Fix the extension not working on non-Macs](https://github.com/PEZ/paste-replaced/issues/4), thanks @KcZer0 and @AndrewRocky! 🙏

## [1.1.9] - 2022-11-14
## [v1.1.9] - 2022-11-14

Internal stuff:

- Catch any activation errors.
- Avoid deprecated API Call.

## [1.1.8] - 2022-11-12
## [v1.1.8] - 2022-11-12

- Fix bug with command **Copy Selected Text and Paste** not working in most cases

## [1.1.7] - 2022-11-12
## [v1.1.7] - 2022-11-12

- Actually fix bug with backward compatability with old config format 🤦

## [1.1.6] - 2022-11-12
## [v1.1.6] - 2022-11-12

- Fix bug with backward compatability with old config format

## [1.1.5] - 2022-10-25
## [v1.1.5] - 2022-10-25

- Fix bug with referencing named replacers
- Add OPEN README message when opening menu with no valid replacers are configured

## [1.1.4] - 2022-10-25
## [v1.1.4] - 2022-10-25

- Changed default paste-replaced keyboard shortcut to `ctrl+alt+v space`
- Add Paste Replace... menu
Expand All @@ -53,7 +55,7 @@ Internal stuff:
- Keyboard shortcuts can now provide **replacers**, and select command ids (and `simulateTypingSpeed`, and `skipPaste`)
- Add `string` type `replacements` for pasting/typing verbatim

## [1.1.3] - 2022-05-31
## [v1.1.3] - 2022-05-31

- Add some logging when Paste Replaced starts and finsishes activating

Expand Down
6 changes: 5 additions & 1 deletion bb.edn
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
{:requires ([tasks :as t])

publish {:doc "Publish the extension"
:task t/publish!}}}
:task t/publish!}

release-notes {:doc "Get release notes for <version>"
:task t/print-release-notes!}
}}
4 changes: 2 additions & 2 deletions scripts/publish.clj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
(apply p/sh args)))

(defn release-pattern [version]
(re-pattern (str "## \\[" (string/replace version "." "\\.") "\\]")))
(re-pattern (str "## \\[" (string/replace version "." "\\.") "\\].*")))

(defn get-changelog-text-for-version [version]
(let [pattern (release-pattern version)]
Expand All @@ -33,7 +33,7 @@
.toString
(clojure.string/split #"T")
(nth 0))
new-header (format "## [%s] - %s" version utc-date)
new-header (format "## [v%s] - %s" version utc-date)
new-text (string/replace-first
changelog-text
(release-pattern "Unreleased")
Expand Down
6 changes: 5 additions & 1 deletion scripts/tasks.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
(:require publish))

(defn publish! [& args]
(apply publish/run args))
(apply publish/run args))

(defn print-release-notes! [version]
(let [changelog-text (publish/get-changelog-text-for-version version)]
(println changelog-text)))

0 comments on commit 0ade363

Please sign in to comment.